Question
In C++ please In the sport of diving, seven judges award a score between 0 -10. Each score may be a double value. The scores
In C++ please
In the sport of diving, seven judges award a score between 0 -10. Each score may be a double value. The scores are added together, with the highest and lowest scores are thrown out. This sum is then multiplied by the degree of difficulty for the dive. The degree of difficulty ranges from 1.2 to 3.8 points. The result is then multiplied by 0.6 to determine the divers final score.
You are to write a program which calculates a divers final score, accepting the degree of difficulty and individual judge scores as input from the user.
Your solution is to have the following functions defined:
void getDegree(double& degree)
This function accepts one ref parameter to be updated by the function. The function prompts the user for a degree of difficulty, reprompting the user until a valid value is entered, and returns the result in the reference parameter.
void getScores(double scores[], int numScores)
This function accepts two parameters, a double array and the length of that array. The function prompts the user for scores, and fills the array. The function should make sure that the user enters valid scores.
double sum(const double scores[], int numScores)
This function accepts two parameters, a double array and the length of that array. This function accepts one double array as a parameter, and returns the sum of the array.
double highest(const double scores[], int numScores)
This function accepts two parameters, a double array and the length of that array. The function returns the largest value in the array.
double lowest(const double scores[], int numScores)
This function accepts two parameters, a double array and the length of that array. The function returns the smallest value in the array.
double average (vector
This function accepts one
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