CSC 216 F09/Interfaces: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Pirate Implements Person==
==Pirate Implements Person==


===How to Implement Interfaces===
===Purpose of this Exercise===


Describe what you are attempting to teach students by this exercise.
Through this exercise, students can come to a better understanding of interfaces and their implementation.  This is a simple exercise that makes a concept that can sometimes be confusing, relatively simple.


===Participants and props===
===Requirements for the Game===


How many students will participate?  What else do you need (e.g., old tennis ball, Powerpoint slides, software).
This game is to be played by a group of 4 or 5 students.  The instructor will only need a white board or a chalk board, so that the students can draw for the entire class to see.


===The script===
===How the Game is Played===


Describe how to do your exercise.
The instructor will give them instructions of how to create a person.  In other words they will give requirements necessary for a stick figure of a person, such as a head, body, mouth, and eyes.  each student will draw this person, and they should all be the same.  This first step represents the interface Person.


Next, the instructor will tell the students that there is a class called Pirate, which will implement interface.  That means that Pirate must also have a head, body, mouth, and eyes.  However we want Pirate to be able to do more than just what Person could.  So, we will also require other important characteristics, such as arms, legs, pirate hat, and parrot.  The students will then be asked to create their own Pirate, while making sure to implement Person in their drawing.


<embed src="http://www.metacafe.com/fplayer/3751899/learning_project_for_csc226_implementation_in_java.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_3751899"> </embed><br><font size = 1><a href="http://www.metacafe.com/watch/3751899/learning_project_for_csc226_implementation_in_java/">Learning Project for Csc226: Implementation in Java</a> - <a href="http://www.metacafe.com/">Watch more amazing videos here</a></font>
[[Image:Csc226vid_pirate.avi.GIF]]
 
http://www.metacafe.com/watch/3751899/learning_project_for_csc226_implementation_in_java/

Latest revision as of 19:04, 17 November 2009

Pirate Implements Person

Purpose of this Exercise

Through this exercise, students can come to a better understanding of interfaces and their implementation. This is a simple exercise that makes a concept that can sometimes be confusing, relatively simple.

Requirements for the Game

This game is to be played by a group of 4 or 5 students. The instructor will only need a white board or a chalk board, so that the students can draw for the entire class to see.

How the Game is Played

The instructor will give them instructions of how to create a person. In other words they will give requirements necessary for a stick figure of a person, such as a head, body, mouth, and eyes. each student will draw this person, and they should all be the same. This first step represents the interface Person.

Next, the instructor will tell the students that there is a class called Pirate, which will implement interface. That means that Pirate must also have a head, body, mouth, and eyes. However we want Pirate to be able to do more than just what Person could. So, we will also require other important characteristics, such as arms, legs, pirate hat, and parrot. The students will then be asked to create their own Pirate, while making sure to implement Person in their drawing.

http://www.metacafe.com/watch/3751899/learning_project_for_csc226_implementation_in_java/