CSC 221: Computer Programming I         Spring 2008

HW 3: Class Design and Implementation

For this assignment, you are to extend the functionality of the ScoreKeeper class that was developed as an in-class exercise. As we originally defined it, the ScoreKeeper class had methods for specifying a made basketball shot (either a 3-point field goal, a 2-point field goal, or a 1-point free throw) and also a method for accessing the current score. For this assignment, you will need to extend the functionality of this class so that:

The javadoc file ScoreKeeper.html gives a full description of the class and the exact form that the methods must take. Your class implementation should include comments (both at the top of the class and at each method) so that BlueJ's interface view would produce a similar page.

It is strongly recommended that you develop and test your class in stages. For example, first specify the fields and constructor, then use BlueJ to create an object and inspect its fields to make sure they are correct. Next, implement the made and getScore methods, making sure that you can record each type of made shot and update the score accordingly. Finally, move on to missed and reset.

Once you have fully tested your class, you can download the file and add it to your BlueJ project. The ScoreGUI class defines a graphical user interface (GUI) that allows you to select a missed or made shot at the click of a button, and then see the score and percentages automatically updated. Once you have compiled this class, you can open up an interface window by right-clicking and selecting void main(String[]).

Submit your file via the Digital Dropbox.