CPSC 120 Assignment #2
Due, Friday October 14, 2004 by 5:00 p.m.

In Lab 3, you created an applet to play a game of darts. Clearly that implementation was very simplistic - it provided a visual representation, but didn't even keep score. For this assignment, you are going to rework the darts applet to work with classes and conditional statements to provide a more robust (and fun!) game.

There are two major types of objects that we want to use for this game: Darts and DartBoards.

The Dart Class: Just like the lab, we will represent the dart with an "X" on the screen. Hence the Dart class should have the following:

The DartBoard Class: For this program, a dartboard consists of 4 concentric circles, with a bullseye (inner-most circle) that has a radius of at least 40. The DartBoard class should have:

Click here for a note on positioning of the dart board.

Your applet should draw a dartboard, throw 3 darts, and report the cumulative score.

Some Hints: Do your work in small chunks testing each before going to the next. A suggested order is as follows.

Additional requirements:

Grading: 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 your instructor with a subject of cpsc120 project2.