I have it close but not complete.Project Requirements1. Develop.docx

This preview shows page 1 - 4 out of 16 pages.

I have it close but not complete. Project Requirements: 1. Develop a program that will handle a Golfer and his scores. The program will be comprised of three classes: a Golfer class that will manage all the golfer's scores, a Score class and a Tester class to drive the other classes. To accomplish this task the program will use a partially filled array to store the golfer s scores. 2. The Golfer Class a. This is a class designed to represent a golfer including his name, home course, id number and an Array of Score Objects. The golfers scores consist of several pieces of information include the course, the par score for the course, the courses rating and course slope, date score was shot and the score. Each field is explained in detail below. Remember part of being a strong programmer is being flexible enough to learn about new domains, you don't have to be a golfer or a doctor or a banker to write application in those domains. b. Instance Variables: I. name - A String representing the golfer's name II. homeCourse - A String representing the golf course where the player's handicap is keep. III. idNum - A unique integer that identifies each golfer. IV. scores an Array - stores Score object that represent the golfer's scores. Set the size of the array to 10 but use numOfScores instance variable(below) to track how many Score object are actually in the array. ((NOTE: MUST USE
AN ARRAY, CANNOT USE ANY OTHER TYPE OF JAVA COLLECTION OBJECT) V. numOfScores an int representing the number of Score Objects in the Array used in the partially filled array algorithm c. Static Variable - int nextIDNum - starts at 1000 and is used to generate the next Golfer's IDNum d. Methods 1. Constructor - sets name and homeCourse from parameters and uses the static variable nextIDNum to retrieve the next available ID number. Creates Array. 2. Constructor - default constructor, sets all instance field to a default value. Creates Array. 3. Accessor and mutator methods as identified in the UML Class Diagram below) NOTE Mutator method for IDNum should use the static variable nextIDNum. Mutator method should be used to set all instance fields (no accessor or mutator method for scores instance variable) 4. addScore - create a Score object from the parameters that represent the course, score, course rating, course slope, and date. Adds the newly created Score object to the Array of Scores.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture