CS110 Introduction to Computing
Spring 2006
Assignment#4: Interfaces and Peer Objects
Due in class on Tuesday, February 21, 2006
Deadline extended to Tuesday, February 28, 2006
In this exercise, we will get hands-on experience with using Java interfaces, and the use of peer objects.
What to do: Read the entire Chapter 4 from Sanders & van Dam and make sure you understand the concepts of interfaces and peer objects. Your task is to follow the steps in Section 4.5 to implement the movable hat application.
Additionally: Do each o fthe following:
Extra Credit: Modify the setSize method in Hat class to make use of the width and height parameters. That is, the size of the hat should be whatever the actual parameters of setSize are. Create a Hat that is 160 x 140. Think first before jumping ahead to do this. You will need to change some other things in the implementation as well!
Notes:
Hand in: A prinout of the final version of the Java program from above. Include your answers from Questions above. Also, include a prinout of the picture produced by your program. Conclude your work by a short essay (just a few sentences) on your thoughts about your understanding of the Java programming concepts you have learned so far.
Also: As soon as you are successfully done, send an email to Deepak telling him that you were able to successfully complete your assignment.
Back to CS110 Spring 2006 Materials.