Display the diver's information and overall score.
After all divers have been processed, a summary report listing the number of divers and the average score of the divers will be displayed to the screen.
When writing this lab, use nested loops. A nested loop is where one loop is completely contained in another loop. In an inner loop you will read the 5 scores one at a time. Every time you read the score (in the loop), you will compare the score to the highest so far and also to the lowest so far, so that you can determine the highest and lowest scores in addition to adding the scores up one at a time.
You also need to have your program process multiple divers. Put this in an outer loop. After you process the information for one diver, prompt the user if she/he wants to process another diver. Allow the user to type either a 'Y' or a 'y' to enter another diver's information; otherwise, exit the loop. Write an event summary by calculating and displaying the average score for all divers and the total number of divers participating.
The data being entered by the user needs to be validated. GIGO - Garbage In/Garbage Out. Scores by judges may range between 0 and 10 inclusive. If the user enters an invalid score, display an error message, and prompt for the score again. Keep doing this until the user enters the score correctly. The degree of difficulty may range from 1.00 to 1.67 inclusive.
Write report heading
Loop as long as there are divers to process
Input diver's name and city
Initialize highest score, lowest score and total score
Using a do-while loop input the 5 judge's scores
Validate the score to ensure it is between 0 and 10
Add score to total
Determine highest and lowest scores
Input and validate the degree of difficulty
Calculate the overall diver's score
Display the diver's information and overall score
Add diver's overall score to the final score
Add 1 to the number of divers
Prompt the user if she wants to process another diver
End-Loop
Calculate the average score for all divers
Display the number of divers and the average score for all divers