In the sport of diving, seven judges award a score between 0 and 10, where each score may be a floating-value. The highest and lowest scores are thrown out and the remaining scores are added together.

In the sport of diving, seven judges award a score between 0 and 10, where each score may be a floating-value. The highest and lowest scores are thrown out and the remaining scores are added together. The sum is then multiplied by the degree of difficulty for that drive. The degree of difficulty ranges from 1.2 to 3.8 points. The total is then multiplied by 0.6 to determine the diver’s score.

Write a program that inputs a degree of difficulty and then input seven judges’ scores using a loop and outputs the overall score for that dive.

Don't use plagiarized sources. Get Your Custom Essay on
In the sport of diving, seven judges award a score between 0 and 10, where each score may be a floating-value. The highest and lowest scores are thrown out and the remaining scores are added together.
Just from $8 /Page 0r 300 words
Order Now

You are required to check whether a judge’s score is indeed between 0 and 10. You also have to check whether the difficulty is between 1.2 and 3.8. When the user enters a number that is not in the range, ask the user to enter it again.

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

Example: To ask the user to enter a score between 0 and 100

do{

cout<<”Enter a number between 0 and 100”;

cin>>score;

}while(score<0 || score>100);

Hint: You should use a loop to find total score, highest score, and lowest score. You then subtract total from highest and lowest. Multiply result by difficulty and 0.6 to get the final score. If the user enters difficulty as 2 and seven judges give score as 1, 2, 3, 4, 5, 6, and 7. Then the final score should be 24

 

do it in C++

Looking for a similar assignment? Get help from our qualified experts!

Order Now