Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 thrown out and the remaining five scores are added together. The sum is then multiplied by the degree of difficulty for that 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 in the standard mode that inputs a degree of difficulty and seven judges scores, and outputs the overall score for that dive. The program should ensure that all inputs are within the allowable data ranges. To make your programming easier, if a number is out of range (greater than the upper limit or less than the lower limit), then let the program replace it with upper or lower limit numbers. Save the file as ExtraCredit.java, and this program is due the last day of Week 5.

Hint: Use a double Array (that holds only double numbers) and a for loop statement to store each Judges score

Hint: Use a variable with the initial value of 0 for the highest score, and a variable with the initial value of 10 for the lowest score, in order to find out the highest and the lowest scores. You should compare each score to these variables.

*** sample output

Please enter the difficulty level(1.2 - 3.8): 1

Enter the score of judge 1: 5

Enter the score of judge 2: 4

Enter the score of judge 3: 3

Enter the score of judge 4: 2

Enter the score of judge 5: 1

Enter the score of judge 6: 6

Enter the score of judge 7: 7

Scores = { 5 4 3 2 1 6 7 }

Difficulty level = 1.2

Total score = 14.4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions