Question: * * JAVA please * * * Project 1 Mini Golf Score Stats Write a program that will analyze the results for the scorecard of

**JAVA please*** Project 1 Mini Golf Score Stats
Write a program that will analyze the results for the scorecard of a miniature golf game.
A mini golf course usually has 14 holes, and is played by 2-4 players. Points for any single hole can be
anywhere from 1 to 6. The best score for a hole is 1,(hole-in-one)! And the worst score for a hole is 6.
Your program will read the scores from a file containing data for 2-4 players and identify the best score
(lowest points), worst score (highest points) and the total for each player.
General requirements
1. Your program should have multiple functions, at least 4 different functions
a. The main function should control the overall program, displaying a menu with options
for the user.
i. The main program should allow the user to read a file and find information on
the players multiple times.
b. At least one function that defines parameters.
c. At least one function that returns a value.
d. At least one function that accepts arrays as parameters.
2. Your program should use loops.
a. At least one conditional loop (while or do-while)
b. At least one standard for loop
c. At least one conditional loop with a sentinel value (while or do-while)
d. You may use other loops, for instance a for-each (enhanced for loop)
3. Your program should have conditions.
a. if /else
b. either if/else if or switch/case statement for multiple decisions
4. Use style and conventions as shown in class, using style or conventions not seen in class may
cause you to not get credit.
a. Use lower camel case convention for naming your identifiers.
b. Choose descriptive names for variables and methods.
c. Avoid using literals, for example if your array is of size 20, you should create a constant
variable. For example declare public static final MAX_SIZE =20 and then use MAX_SIZE
throughout your program. Do not have code like int[20], instead have code like
int[MAX_SIZE].*You may need 2 or more constants in your program.
d. Indent your code and use white space as recommended to make your code easy to
read.
e. Include comments in your code to describe what each method does and other
important concepts/parts in your methods.
Specific requirements
1. Your program should read the mini golf score card for a group of players and store it using
arrays. Hint: This functionality fits well within a method.
a. Ask the user for the name of the file that contains the scorecard information.
i. If the file does not exist, display an error for the user to let them know the file is
not found, and allow the user to enter a new name.
ii. Repeat the process until the user enters a valid filename.
b. A scorecard file should have between 2 and 4 players.
c. The data in the scorecard is a csv (comma separated value) file with the following fields:
Name, pts_hole1, pts_hole2,...., pts_hole13, pts_hole14
d. Read the data, and store it in two arrays:
i. A one-dimensional array, nameArray should store the names of the player.
ii. A two-dimensional array, scoreArray should store the points for every hole for
every player.
iii. nameArray and scoreArray are parallel arrays, i.e. The points in the scoreArray
at index 0 are for the player at index 0, the points for player at index 1 in
nameArray are at index 1 in the scoreArray, etc.
nameArray scoreArray
John 15164652534436
Susan 44555335334424
Lauren 42155555666132
Michael 65612165315264
2. After data is read from the file, the user should have the following options:
Hint: This is another great fit for a method. You may also use (and call) additional methods to
find the players and display the user data.
a. Find the player with the least points (first place)
b. Find the player with the most points (last place)
c. Display the total points and the average points per hole for each player.
3. Write a new file that contains all the original information, plus the total and average points for
each player. Hint: Also makes for a useful method
Name, pts_hole1, pts_hole2,...., pts_hole13, pts_hole14, total_pts, avg_pts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!