CSC 216/s08/cultivate virtue: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Alphabet Soup)
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
==Alphabet Soup==
==Alphabet Soup==


Give the title of your exercise, which may include the name of the topic you are covering, or some other catchy title.


===The goal is to teach students about object oriented concepts and multi class/method architectures in programming Java.===


Describe what you are attempting to teach students by this exercise.
===Object Oriented Instruction===
Many students enter csc 216 with very little idea of what it is for a programming language to be 'object oriented.'  Our goal is to help students understand the benefits of a system that allows for black box architecture in a closed source environment.


===The exercise will include each student in the class.  26 of the students will need access to either letter stamps or dry erase markers.===
===Required Resources===
For this exercise participating students will want to be close to a white board and have access to a working dry erase marker.  No other resources are needed.


How many students will participate?  What else do you need (e.g., old tennis ball, Powerpoint slides, software).
===The Exercise ... dum dum dum===
The idea here is to create a working human powered version of a sentence writing class. Obviously such a thing is not actually useful or even logical in a Java environment but we feel that it's a great way of explaining the power of object oriented programming.


===The class will create a sentence construction package which will be used for several 'ad lib' type exercisesNumbers allowing 26 students will each be a letterPreferably each person who is a letter has access to a stamp of their letter, another option would be to simply use a dry erase board for writing on.  7 students will each represent classes pertaining to noun, verb, adjective, adverb, preposition, conjunction, and interjectionOne person will be the overall package 'driver.' It is this person's job to say, "Alright, I need a noun, I will call my noun class," or "I need a verb, I'll make a call to my verb class." Upon being called, the noun class person then comes up with a word that fits his/her bill (ie a noun) and makes appropriate calls to the people of the letter classes.  The letter classes, upon being called, write or stamp their letter in the next position on the board.
First, the architecture. 
-At the lowest level are the lettersStudents will be given a group of letters that fall within their jurisdictionFor example, the vowel class student would have a,e,i,o, and u under their control.  As many or as few letters as desired can get given to any individual studentPunctuation marks can also be included here if desired.  The job of each student of the letter class category is simpleWhen called (which is as simple as a higher class saying "I need an 'a' or I need a capitol 'a'") the student writes the required letter/punctuation mark at the next available place on the board.  The student in charge of spaces should make some identifying mark, such as an underscore to designate a space.


A slightly different version, which makes use of methods, and a slightly smaller class/fewer participating students would group letters into one class with multiple methodsFore example, one student would be the vowel class and would have the methods printA, printE, printI, printO, printU (we'll leave y to the consonants for this exercise).  And similar groupings of letters would be used for other students, such as b,c,d,f,g or some appropriate amount for the number of participating studentsThen when the noun class decided to print 'hobgoblin' he/she would call a class .printH then vowels.printO, and so on and so forth.
-At the level above the letters are the word classesThere are nine of these (noun, verb, adjective, adverb, preposition, conjunction, and interjection).  One of these should be given to each of nine students.  The job of these classes is a little more interesting than that of their letter brethren.  When called, it is their job to come up with a word that fits their category; so for example, when noun is called (again, by someone of a higher class saying "I need a noun") the noun class person might come up with the noun ball, or tree, or anything they so desire, much in the spirit of ad libsHaving come up with a word, the class then makes calls to the letter classes in order to 'print' the desired word to the board.


While not perfect, this setup allows students to see how they can create classes with methods that other classes can also use.  It should help break the "I'll use one class with one main method" that many students carry.===
-We will have one class that acts as manager.  This is the class that makes calls to noun and verb and etc.  It is also this classes responsibility to make a call to 'space' between words.  The creativity of this class can allow the exercise to be entertaining and fun.


Describe how to do your exercise.
===Thoughts===
This exercise doesn't encompass sections of Java that are necessarily hard to understand.  Instead it strives to help students get into an object oriented mindset.  The ability to program cannot truly be taught.  Instead we can only help students to try and understand how an object oriented language like Java works.  Once students begin to grasp the power inherent to a language like Java.

Latest revision as of 08:23, 4 April 2008

Formatting Resources

Formatting Help Guide from MetaWiki

Alphabet Soup

Object Oriented Instruction

Many students enter csc 216 with very little idea of what it is for a programming language to be 'object oriented.' Our goal is to help students understand the benefits of a system that allows for black box architecture in a closed source environment.

Required Resources

For this exercise participating students will want to be close to a white board and have access to a working dry erase marker. No other resources are needed.

The Exercise ... dum dum dum

The idea here is to create a working human powered version of a sentence writing class. Obviously such a thing is not actually useful or even logical in a Java environment but we feel that it's a great way of explaining the power of object oriented programming.

First, the architecture. -At the lowest level are the letters. Students will be given a group of letters that fall within their jurisdiction. For example, the vowel class student would have a,e,i,o, and u under their control. As many or as few letters as desired can get given to any individual student. Punctuation marks can also be included here if desired. The job of each student of the letter class category is simple. When called (which is as simple as a higher class saying "I need an 'a' or I need a capitol 'a'") the student writes the required letter/punctuation mark at the next available place on the board. The student in charge of spaces should make some identifying mark, such as an underscore to designate a space.

-At the level above the letters are the word classes. There are nine of these (noun, verb, adjective, adverb, preposition, conjunction, and interjection). One of these should be given to each of nine students. The job of these classes is a little more interesting than that of their letter brethren. When called, it is their job to come up with a word that fits their category; so for example, when noun is called (again, by someone of a higher class saying "I need a noun") the noun class person might come up with the noun ball, or tree, or anything they so desire, much in the spirit of ad libs. Having come up with a word, the class then makes calls to the letter classes in order to 'print' the desired word to the board.

-We will have one class that acts as manager. This is the class that makes calls to noun and verb and etc. It is also this classes responsibility to make a call to 'space' between words. The creativity of this class can allow the exercise to be entertaining and fun.

Thoughts

This exercise doesn't encompass sections of Java that are necessarily hard to understand. Instead it strives to help students get into an object oriented mindset. The ability to program cannot truly be taught. Instead we can only help students to try and understand how an object oriented language like Java works. Once students begin to grasp the power inherent to a language like Java.