You are writing a program to calculate the average overall scores for two divers in a diving competition. The competition has 5 judges, each from a different country. Each judge will award each diver a score between 0 and 10. Your program will include the following functions
- getScore: One double reference parameter. In this function, ask for the name of the country giving the score and the score amount. If the score amount is invalid (i.e. not between 0 and 10), ask again. Return the country name and “return” the score (i.e. use a reference parameter).
- findSmallest: Five double parameters. The smallest amount is returned.
- findLargest: Five double parameters. The largest amount is returned.
- getAverage: Five double parameters. The lowest and highest scores should be dropped, and the remaining three should be averaged. You can determine which three should be averaged by adding all five numbers together, then calling findSmallest and findLargest and subtracting both return results from the total. Then, average the remaining score. Return the result.
- scoreDive: This function will return the average overall score for a single diver. It should call getScore five times. Afterwards, print out each country’s name and corresponding score. Finally, call getAverage (passing the five scores) and return the result.
In main, call the scoreDive function twice, once for diver 1 and once for diver 2. Then, print the final score earned by each.


0 comments