Menu

Machine Problem 7 Structures Completed C Assignment Give Practice Using One Dimensional Ar Q43824685

Machine Problem 7: Structures —- TO BE COMPLETED IN C++

This assignment is to give you practice using one-dimensionalarrays and sorting.

In competitive diving, each diver makes dives of varying degreesof difficulty. Nine judges score each dive from 0 through 10 insteps of 0.5. The difficulty is a floating-point value between 1.0and 3.0 that represents how complex the dive is to perform. Thetotal score is obtained by discarding the lowest and highest of thejudges’ scores, adding the remaining scores, and then multiplyingthat total by the degree of difficulty. Write a program to scoreeach of the dives, using the following input and outputspecifications, and determine the winner of the competition.

Input:

Create the file m6dive.txt

The first line contains an integer for the number of divers inthe competition and subsequent lines contain:
Diver’s name (10 characters max, no blanks included), difficulty(double), and judges’ ratings (nine doubles). There is one line ofdata for each diver.

Example file:

Anne2.08.08.58.58.59.09.09.09.59.5124.0Sarah1.67.07.58.08.08.08.58.58.59.091.2

Output:

The name and difficulty, followed by the scores sorted intoincreasing order, in tabular form with appropriate headings alongwith the earned total points for that dive.

Example for sample data above

NAMEDIFFSORTED SCORESPOINTSAnne2.08.08.58.58.59.09.09.09.59.5124.0Sarah1.67.07.58.08.08.08.58.58.59.091.2

At the end of the table, print out the name of the winner of thecompetition (the person with the highest points) and his/her finalscore.

Hint: Use functions to modularize your program.

NAMEDIFFSORTED SCORESAnne2.08.08.58.58.59.09.09.09.59.5Sarah1.67.07.58.08.08.08.58.58.59.0Deborah2.39.09.09.510.010.09.59.59.59.5Kathryn2.49.09.09.09.59.59.59.08.08.5Martha2.79.09.09.59.59.08.58.58.58.5Elizabeth2.98.08.07.58.58.58.08.07.58.5Tina2.58.58.58.58.58.58.58.58.58.5

Expert Answer


Answer to Machine Problem 7: Structures —- TO BE COMPLETED IN C++ This assignment is to give you practice using one-dimensional …

OR