Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The state diving commission wants to computerize the scoring at its diving compe

ID: 3643933 • Letter: T

Question

The state diving commission wants to computerize the scoring at its diving competitions. You've been hired to write a program to automate the scoring of dives. Following are the requirements for the program.

After each dive, the user will be prompted to enter the:

diver's name;
diver's city;
degree of difficulty (ranges from 1.00 to 1.67); and
scores from five judges (scores can range from 0 to 10).
If an invalid score is entered, an error message will be displayed. The user will be prompted for the score repeatedly until a valid score is entered.

The program will then display the following information:

Diver's name
Diver's city
Dive final score: This is calculated by dropping the highest and lowest of the five judges' scores. The remaining three scores are added together, and the result is divided by 3 and then multiplied by the degree of difficulty.
The program will then prompt the user if she/he wants to process another dive. The user can type "Y" or "y" to continue, and "N" or "n" to quit.

Sample output:

Diver's name: Sue Jones
Diver's city: Dallas
Dive degree of difficulty: 1.9
Invalid degree of difficulty - Please reenter (Valid Range: 1 - 1.67)
Dive degree of difficulty: 2
Invalid degree of difficulty - Please reenter (Valid Range: 1 - 1.67)
Dive degree of difficulty: 1.2

Judge #1 score: 45
Invalid score - Please reenter (Valid Range: 0 - 10)
Judge #1 score: 3
Judge #2 score: 4.5
Judge #3 score 6.7
Judge #4 score 89
Invalid score - Please reenter (Valid Range: 0 - 10)
Judge #4 score 8
Judge #5 score: 9.2

Diver: Sue Jones
City: Dallas
Dive score: 7.68

Do you want to process another dive (Y/N)? y

Diver's name: Dave Smith
Diver's city: Houston
Dive degree of difficulty: 1.1
Judge #1 score: 5.7
Judge #2 score: 6.8
Judge #3 score:: 7.6
Judge #4 score: 8.7
Judge #5 score: 6.7

Diver: Dave Smith
City: Houston
Dive score: 7.74

Do you want to process another diver (Y/N)? N

Explanation / Answer

using System; using System.Collections.Generic; namespace Examples { public class Program { protected const double MAX_DEGREE_DIFF = 1.67; protected const double MIN_DEGREE_DIFF = 1.0; protected const double MAX_SCORE = 10.0; protected const double MIN_SCORE = 0.0; public static void Main(string[] args) { string dname = string.Empty; string dcity = string.Empty; double degreofdifficulty = 0; double[] scores = new double[5]; string nextDiver = "N"; do { Console.Write(" Diver's name : "); dname = Console.ReadLine(); Console.Write(" Diver's city : "); dcity = Console.ReadLine(); do { Console.Write(" Dive degree of difficuly : "); degreofdifficulty =Double.Parse(Console.ReadLine()); if(degreofdifficulty > MAX_DEGREE_DIFF || degreofdifficulty = MIN_DEGREE_DIFF && degreofdifficulty
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote