Homework 1

This assignment is worth up to two extra credit points. Most students will receive only one point; only the highest quality answers will receive two points. The questions below refer to the UML model available here. It is also shown on slide 25 of lecture 2.

1. Implement this model in two different object-oriented languages similar to what was shown in lecture 2 for the Airplane/Jet example. The function roam() should simply update the location of the animal any way you see fit. You can assume that the Point class has getter and setter methods for attributes x and y.

2. Write a program that creates instances of Cat and Lion and interacts with them in some way. At least one part of your program, should store these instances into an array of type Feline and then interact with both Lions and Cats via the Feline interface.

3. If we wanted to add a Hippo, Elephant, Dog, and Wolf to the simulation, we would want to update the UML model in some fashion (possibly adding additional classes than just these four). Create a diagram that shows the UML model updated in this way.

This assignment is due by 11:55 PM on Thursday, September 4th. Please upload a zip archive to the moodle that contains the source code for your answers to questions 1 and 2 (along with a README file that provides detail on about your implementation and directions on how to run it) and a PDF file that contains your answer to question 3.

Any questions, send them to Prof. Anderson. Recall that you must not work with other students on this assignment. To remind you of this, please include the following pledge at the top of your README file:

"On my honor as a University of Colorado at Boulder student, I have neither given nor received unauthorized assistance on this work."

Kenneth M. Anderson, 2008