CSC 216/s08/be cheerful: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
(Initial proposal)
Line 1: Line 1:
===Formatting Resources===
==That's what it's all about!==
[http://meta.wikimedia.org/wiki/Help:Wikitext_examples Formatting Help Guide from MetaWiki]


==Place Title of Exercise Here==
===The problem===


Give the title of your exercise, which may include the name of the topic you are covering, or some other catchy title.
Teach the value of superclassing and writing DRY code to prevent error.


===The problem===
===Participants===


Describe what you are attempting to teach students by this exercise.
3 group members: 1 programmer and 2 classes
Possibly volunteers to do the hokey pokey?
How many students will participate?  What else do you need (e.g., old tennis ball, Powerpoint slides, software).
Participants:


===Participants and props===
===Hokey Pokey Music/Video Candidates===


How many students will participate? What else do you need (e.g., old tennis ball, Powerpoint slides, software).
* http://video.google.com/videoplay?docid=-4742763335053216439
* http://video.google.com/videoplay?docid=8805519462208735145


===The script===
===The script===


Describe how to do your exercise.
# The coder first creates two or more people classes that are supposed to do the Hokey Pokey.  He tells them individually how to do the hokey pokey. 
# Because he has a bad memory, he forgets to tell one to turn himself about and to do the incorrect 2nd action.
# They dance the first 2 segments (right foot, left foot) and get it wrong.
# The coder decides to use superclassing and inheritance so that all of his people share the same instructions -> show the video.
# They dance the next 2 segments (right arm, left arm) right!
# The best part is that now that I have a superclass, I can extend HokeyPokey to as many classes as I want! Like... the whole class! ;)
# Those willing can watch the video and do the hokey pokey with us. :D
# Reiterate how this example applies to real programming.

Revision as of 20:42, 22 March 2008

That's what it's all about!

The problem

Teach the value of superclassing and writing DRY code to prevent error.

Participants

3 group members: 1 programmer and 2 classes Possibly volunteers to do the hokey pokey? How many students will participate? What else do you need (e.g., old tennis ball, Powerpoint slides, software). Participants:

Hokey Pokey Music/Video Candidates

The script

  1. The coder first creates two or more people classes that are supposed to do the Hokey Pokey. He tells them individually how to do the hokey pokey.
  2. Because he has a bad memory, he forgets to tell one to turn himself about and to do the incorrect 2nd action.
  3. They dance the first 2 segments (right foot, left foot) and get it wrong.
  4. The coder decides to use superclassing and inheritance so that all of his people share the same instructions -> show the video.
  5. They dance the next 2 segments (right arm, left arm) right!
  6. The best part is that now that I have a superclass, I can extend HokeyPokey to as many classes as I want! Like... the whole class! ;)
  7. Those willing can watch the video and do the hokey pokey with us. :D
  8. Reiterate how this example applies to real programming.