CS 132
Computer Science II
Old Fish, New Fish, Red Fish, Blue Fish
David B. Levine
Computer Science Department
St. Bonaventure University
Copyright, 2000
Objective
This lab is designed to force you to explore the simulation with less
guidance than you have previously shown. You will make two changes to the
graphical version of the case study. In each case, you must determine - on
your own - which classes need to be changed, and what those changes entail.
Instructions:
- Make a copy of last week's project. (Do this in Windows Explorer, not from
within CodeWarrior.) Launch that copy and verify that it works properly.
- The first change is to have the fish show their direction. A fish's direction should be "Right" if its last move was NorthEast, East, or SouthEast - OR if its last move was North or South and it was already heading "Right". Otherwise a fish's direction should be "Left". We don't worry about "Up" or "Down".
Before you begin coding this, make a list of which functions you think you will need to change. As you go, if the list needs to be amended, make those amendations.
- Add a new attribute to Fish objects, namely their age. Have fish be displayed in different colors depending upon their age. Young fish should be displayed in a pastel color (pink?); old fish in a decrepit color (gray?); and middle-aged fish in a bright color (red?).
Again, before you begin coding this, make a list of which functions you think you will need to change. As you go, if the list needs to be amended, make those amendations.
- Once the program is working, save a copy of the executable in the CS132 subfolder of the CourseUploadFolder on the CSNet server.
Hand in:
Hand in a cover page, a neat copy of the two lists of functions that
needed to be changed, and printouts of ONLY those files that needed to be
changed.
Assignment Type (see
Academic Practices and Policies Document):
Group assignment, limited collaboration.