Question: Write a Java program to do the following: In the sport of diving, seven judges award a score between 0 and 10, where each score

Write a Java program to do the following:

In the sport of diving, seven judges award a score between 0 and 10, where each score may be a floating point value. The highest and lowest scores are ignored and the remaining scores are added together. The sum is then multiplied by the degree of difficulty of the dive. The degree of difficulty ranges from 1.2 to 3.8 points. The total is then multiplied by 0.6 to determine the divers score.

Write a Java program to input a degree of difficulty and seven judges scores and output the overall score for that dive. You must use an array to hold the scores.

The program should ensure that all inputs are within the allowable test ranges (and print an appropriate error message and not compute a final score if not).

Write your program so that it scores 4 dives, once for each set of data below. Print a blank line between dives.

Difficulty: 1.6

Scores: 3, 5, 6.7, 5, 8, 4, 5.5

Difficulty: 3.0

Scores: 0, 3, 4, 5, 5.7, 10.5, 5, 3

Difficulty: 2.5

Scores: 6.3, 5.6, 5, 7.8, 5, 6.6, 4.9

Difficulty: 2.7

Scores: 3.3, 5.1, 10, 7.8, 5, 6.2, 4.7

Sample output for the first dive might be:

Dive 1:

Enter the degree of difficulty for the dive (1.2-3.8).

1.6

Enter score for judge 1 (0-10).

3

Enter score for judge 2 (0-10).

5

Enter score for judge 3 (0-10).

6.7

Enter score for judge 4 (0-10).

5

Enter score for judge 5 (0-10).

8

Enter score for judge 6 (0-10).

4

Enter score for judge 7 (0-10).

5.5

The diver's final score is 25.152

For extra credit (3 points maximum):

Use another array to keep track of the final scores and determine a winner at the end of the competition. Print an appropriate message.

Only do this once you have the original program working!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!