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 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 diver’s score

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question

JAVA Programming Problem 2 - Diving

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 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 diver’s score. Write a computer program that will ultimately determine the diver’s score. This program must include the following methods:

  • A method name inputValidScore that inputs one valid score for one judge for one diver. This method will return the valid score.
  • A method named inputAllScores that creates an array to store the scores for all judges for the diver. This method will fill the array with a valid score from each judge. This method does not take input arguments, but it does return the array of scores.
  • A method named inputValidDegreeOfDifficulty that inputs a valid degree of difficulty for the dive. The valid degree of difficulty will be returned from the method.
  • A method named calculateScore that will calculate the score for the diver based on the scores from all judges and the degree of difficulty. The score will be returned from the method.
  • A main method that uses the previous methods to determine the score for the diver and then prints out the score to the console.

Directions

  • You may only use statements that are discussed in the book through Chapter 7.
  • You must not use any Array class or Array method included in the Java libraries to solve this problem.
  • Console input and output must be used to solve this problem.
  • Use the following input values for the final test of this program:
  • Degree of difficulty 2.7
  • Judge #1 score 7.5
  • Judge #2 score 9.5
  • Judge #3 score 5.7
  • Judge #4 score 8.25
  • Judge #5 score 6.72
  • Judge #6 score 10.0
  • Judge #7 score 3.46
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

This is wrong. Suppoeed to four method and call everything in main method. You can look at the question first.

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage