CPSC 120A -- Assignment #3

More Fish (Sorry!!)
Due Thursday, November 20, 2003 by 2:50 p.m.(lab)

In this assignment you will write a Java applet to display an ocean full of fish. Obviously the objects this program will deal with are fish so you also need to write a class to model the fish.

The Java Fish class should model a "Pac-man" style fish similar to the ones you drew in project 2 (without the bubbles!). The only requirements for the fish are that they have a body, with a mouth, and a tail. To model this your class needs the following instance data:

The methods in the class should be the following:

You need to create an applet to display the ocean full of fish. To avoid the problem of double images, use an init method in your applet. There is an example on page 257 but yours will be even simpler - it should set the background color and the applet size. Everything else is in the paint method as usual.

The applet should do the following:

You will need to construct an html file to display your applet.

Other Requirements

As usual, use good programming techniques. You should use good variable names, constants where appropriate, whitespace, and correct indentation and alignment of statements (emacs will do this for you if you let it!). Documentation must include a header with the file name, your name, the date, and a clear, complete description of what the program does. Both the Fish class and the class that draws the applet must be documented.

Hand In

Turn in a printed copy of your program (the source code for both the Fish class and your applet - no need to turn in the HTML file). Tar your directory containing the project and email the tar file to ingram@roanoke.edu.

Academic Integrity Reminder!!! Programming assignments are to be your own work. You may get help on the specifics of the assignment from no one except the instructor. You may not show your program to anyone or look at anyone else's program code (you may view each other's applets, just not the code that made the applet) or share ideas with anyone about how to write the program.