CPSC 120 Assignment #2

Completed Assignment: Friday October 27, 2006 by 4:00 p.m.
Phase I: Friday October 13, 2006 by 4:00 p.m.

In this assignment you will create classes for three graphical objects: an umbrella, a cloud, and a raindrop. These classes could be used to create many different scenes. To illustrate the flexibility you will use them in two different scenes - a beach scene and a weather scene.

Phase I

For this phase you will create the umbrella class and a basic beach scene. Be sure to create a subdirectory of your projects directory for your work. For phase I create the following files.

Umbrella.java In this file you will define a class that models a simple umbrella with the following characteristics:

The umbrella class will have only two methods (unless you have enhancements you want to add): a constructor and a draw method. To instantiate an umbrella a program should be able to specify its location, its width, its color, and whether or not it is open. So, STEP #1: THINK carefully about what parameters the constructor needs including what type each is.

Note that the class will have just one draw method. If the umbrella is open it will draw an open umbrella otherwise it will draw a closed umbrella.

Beach.java This is the main applet for the beach scene. It should contain the following:

Beach.html Of course you need a simple HTML file to view the Beach applet.

Hand in by Friday October 13: Your Umbrella.java and Beach.java classes. Also tar your project directory and send it in an email.


For the remainder of the project you need to create classes for the cloud and raindrop objects and applets that use these objects. Specifications for these will be handed out later.


General documentation requirements:

Grading

If you do not turn in phase I or if you turn in something that doesn't show a good faith effort you will automatically have 10 points deducted from your final assignment grade. Otherwise your work in phase I will not hurt you - it will be turned back to you the Monday after break with comments to help you improve it.

Your final project will be graded both on style and correctness. Style includes adherence to rules for naming of identifiers, use of constants, 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 (this includes Phase I of this assignment). 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.