Question: USING JAVA: The Springfork Amateur Golf Club has a tournament every weekend. The Club would like to keep track of the scores each week and
USING JAVA: The Springfork Amateur Golf Club has a tournament every weekend. The Club would like to keep track of the scores each week and be able to print out the scores. They would also like to know how many players play each week and the average score for the field. They never know how many players will sign up for the tournament so they would like to be able to track the trends over time.
The club president has asked you to design a program that will allow the club secretary to enter data about the players who played in the weekly tournament. He would also like this program to have an option that allows the club to print out the data for a tournament.
Specifications
You will start by creating a menu that will select to enter data or to display the report. It will contain options and should look something like this
Springfork Amateur Golf Club
Tournament Management System
Enter Tournament Data
Print Tournament Data
Exit
Specification for Option Enter Data
Open the output file golftournament.dat
Read in following data from the keyboard
Player's name Last name,First name with no spaces after the comma. Names cannot contain spaces ex Smith,John
Golf score for the player integer number between and inclusive
Handicap for each player integer number between and inclusive
DO NOT PLACE THE DATA IN AN ARRAY
Write the data to the output file using a single write statement
Player Name
Gross Golf Score
Handicap
Add to a counter to keep track of the number of records in the file.
Continue reading player names and scores until the user enters XXXXXXXX into the player name note this record should not appear on the output file
Close the file and display the number of players in the file.
Specification for Option Display Report
Open the golftournament.dat as an input file
Display a heading "Golfer Handicap Gross Score Net Score" and make sure that the information about each golfer lines up under the correct column in the heading.
Read the records in the file until end of file is reached
For each golfer in the file, display the following information on the same line
Name of the golfer
Handicap for the golfer
Gross golf score
Net golf score calculated from the data in the file gross golf score handicap
Add to a counter to keep track of the number of players
Add the golfer's gross score to an accumulator
At the end of the file, display the number of golfers who played the tournament and the average gross score for all golfers.
Specification for Option Exit Program
Display message indication processing is complete
Exit program
Unless Option is selected, the program should redisplay the menu and allow entry of another option.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
