Question
The golf coach of a local high school team would like to hire you to write a program that calculates the average of 5 students
The golf coach of a local high school team would like to hire you to write a program that calculates the average of 5 students on the co-ed golf team after playing three rounds of golf. He would like the program to calculate the average for each student as well as the average for each round. The scores for each student in each round of golf are in the chart below. Also determine the best student average (in golf, the lower scores are better) recorded by the golfers.
a. Use main( ) as the driver function. Write functions to accomplish the following tasks:
1. Prompt and read the names of the 5 students and store them in a one-dimensional array of strings.
2. Prompt for the scores for each player in each round and store these values into a two-dimensional array.
3. Compute the average score for each student for the 3 rounds of golf and stores these values into a one-dimensional array.
4. Compute the average score for each round of golf and store these values into a one-dimensional array.
5. Determine the best student average recorded from the three rounds of golf. Display the information in a table format as shown below. Display all averages to a tenth of a decimal.
Sample Output:
Player Round 1 Round 2 Round 3 Ave./Student
Mike Sims 78 76 74 76.0
Paula Hill 71 78 75 74.7
Steve Jones 72 75 73 73.3
Jill Burton 73 74 72 73.0
Lee Smith 74 79 78 77.0
Ave./Round 73.6 76.4 74.4
73.0 was the best recorded student average from the rounds of golf.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started