Question: Please write this program by JAVA Create a class called Golfer that includes instance fields, methods and a constructor for a single Golfer as described
Please write this program by JAVA


Create a class called Golfer that includes instance fields, methods and a constructor for a single Golfer as described here, Private Instance Fields: 1. 2. String name, the player's name. int [1 strokes, the number of strokes required to sink the ball into the hole. The length of the array is equal to the number of holes played (9) One Constructor Only one constructor that instantiates and initializes the instance fields described above. The input array containing the number of strokes for each hole played is used to assign the values to the array defined as a private instance field above (int [] strokes). The strokes instance field is a copy of the input arra Three Instance Methods 1. (String) toString0 returns a String for one golfer in one formatted String. The output format is the name followed by 9 scores and the total. Use the String.format0 method to generate the output string. 2. (String) getName) returns the name of the given player 3. (int) totalStrokes() returns the total strokes for all holes played by the Golfer. Write a second class and give it a name other than Golfer, for example: GolfDriver. This second class will contain only one method: the main static method. The main method will drive your program by doing the following: Create an array of type Golfer to hold all the player names and scores Your program should read a file of data records. Each data record consists of a name followed by nine scores. The delimiter is a comma followed by any number of spaces Here are the scores to place into the input data file . Par, 3, 5, 4, 3, 4, 3, 5, 3, 4 Ringo, 3, 3, 4, 3, 4, 3, 3, 3, 4 Paul, 4, 5, 4, 3, 6, 3, 5, 3, 5 George, 3, 3, 4, 1, 4, 4, 3, 4, 4 John, 4, 4, 4, 3, 4, 2, 3, 3, 4 The data file should be a simple text file. Your program will open and read the text data e. Note there are two types of data on each input line: a String followed by 9 numbers. You must use the Scanner class to parse the information from each input String of data. The numbers should be written into an integer array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
