CPSC 120B Assignment #2

Due, Friday October 15, 2004 by 4:00 p.m.

Write a Java applet that draws a scene containing two critters of some sort (robots, clowns, monsters, "Big Bird"- like things -- use your imagination -- anything but snowmen) and a flock of birds. Both critters will be of the same type (whatever type you choose) and you will create a class to define the critter. Similarly you will have a class for a bird.

Requirements for the critter class:

Requirements for the bird class:

Your applet that draws a scene containing birds and critters should draw a sky and ground (or ocean if your critters swim). It should instantiate and draw at least 6 different bird objects for the flock of birds (of course these should be drawn in the sky) and at least 2 different critter objects (which should be on the ground). The heights of the critter objects should be random (in some appropriate range). NOTE: Do the random number generation for the height in your applet and send the height as a parameter (instead of generating a random height in the critter class).

Additional requirements:


Your program will be graded both on style and correctness. Style includes adherence to rules for naming of identifiers and use of white space; it also includes coding style such as the absence of unnecessary code (extra comparisons in if's or extra assignments); it includes appropriate documentation. Style will be 20% of the grade on the assignment. Correctness includes meeting all the specifications of the assignment. A program that does not compile has an automatic deduction of 70%; one that does not run has an automatic deduction of 40% no matter how "close" it is to compiling or running. Come see me if you have problems with the assignment. It is important that you get in the habit of producing correct programs!

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 or share ideas with anyone about how to write the program.

Hand IN: A printed copy of your program files (the 3 Java files - you do not need to hand in the HTML file). Tar the .class, .html, and .java files and email the .tgz file to ingram@roanoke.edu with a subject of cpsc120 project2.