COMP 110-003 Fall 2008

Program 3: Statistics

65 points

Assigned: Monday, October 13
*** Updated ***: Thursday, October 23
Due: Friday, October 31 at 2:00pm

Description

*** UNCStats.java WAS UPDATED. PLEASE REFRESH YOUR BROWSER WHEN YOU CLICK ON UNCStats.java IN CASE YOUR BROWSER STILL HAS THE OLD FILE CACHED. ***

This program will give you practice with writing a class from scratch. You will write a class, Statistics, that calculates basketball statistics. I have given you the main program UNCStats.java that will use your Statistics class. You will need to write the class Statistics (in a separate file named Statistics.java) that includes the following:

Constructor:

Mutator methods:

Accessor methods:

You will need to determine your own private instance variables. You should declare all your variables at the beginning of your class and initialize them in your constructor. Once you have completed the methods, you can test your class by compiling UNCStats.java and running the program. Your output should look exactly like this (you should not modify UNCStats.java) (new):

UNC's Tar Heels:
  scored 2641 points
  have a field-goal percentage of 45.84%
  have a free-throw percentage of 75.72%
  have a 3-point field-goal percentage of 36.43%

How to turn in the assignment

Grading

You can also lose points for incorrectly handing in the assignment, not using appropriate white space, not using conventional names for any variables you declare, and not commenting your code where appropriate.