Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A particular talents competition has 5 judges, each of whom award a score between 0 and 10 to each performer. Fractional scores, such as 8.3

A particular talents competition has 5 judges, each of whom award a score between 0 and 10 to each performer.

Fractional scores, such as 8.3 are allowed. A performer’s final score is determined by dropping the highest and lowest score received, then averaging the 3 remaining scores. Write a program that uses this method to calculate a contestant’s score. It should include the following functions: void getJudgeData() should ask the user for a judge’s score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of the 5 judges. void calcScore() should calculate and display the average of the 3 scores that remain after dropping the highest and lowest scores the performer received. This function should be called just once by main, and should be passed the 5 scores.

The last two functions, described below, should be called by calcScore, which uses the returnedinformation todetermine which of the scores to drop.

• int findLowest()should find and return the lowest of the 5 scores passed to it.

• int findHighest()should find and return the highest of the 5 scores passed to it.

Input Validation: Do not accept judge scores lower than 0 or higher than 10.

You may use more functions, but you must use at least the four listed above. Here are the prototypes:

// Function prototypes

void getJudgeData(double &);

void calcScore(double, double, double, double, double);

double findLowest(double, double, double, double, double);

double findHighest(double, double, double, double, double);

- Compile your work frequently to avoid too many errors at one time.

- Verify the parameter lists in the prototype, the call, and the header for each function.

- You can call a function from inside another function.

Program requirements and/or constraints:

• No global variables are allowed!

• program must work for any valid input and not just the values shown in the sample output.
• Don't use material beyond the current topic

Sample run: User input is to the right of the colon or parenthesis:

Enter score between 0 and 10: 8

Enter score between 0 and 10: 7.5

Enter score between 0 and 10: 10

Enter score between 0 and 10: 8

Enter score between 0 and 10: 5

This contestant's talent score is: 7.83

Do you want to enter another set of scores? (y/n)y

Enter score between 0 and 10: 8

Enter score between 0 and 10: 8

Enter score between 0 and 10: 1

Enter score between 0 and 10: 8

Enter score between 0 and 10: 10

This contestant's talent score is: 8.00

Do you want to enter another set of scores? (y/n)y

Enter score between 0 and 10: 8.5

Enter score between 0 and 10: 7.6

Enter score between 0 and 10: 5.5

Enter score between 0 and 10: 9.4

Enter score between 0 and 10: 6

This contestant's talent score is: 7.37

Do you want to enter another set of scores? (y/n)y

Enter score between 0 and 10: 8

Enter score between 0 and 10: 11

Score must be in the range 0 - 10. Please re-enter score: 10

Enter score between 0 and 10: 15

Score must be in the range 0 - 10. Please re-enter score: 15

Score must be in the range 0 - 10. Please re-enter score: 7

Enter score between 0 and 10: 8

Enter score between 0 and 10: 9This contestant's talent score is: 8.33

Do you want to enter another set of scores? (y/n)n

Step by Step Solution

There are 3 Steps involved in it

Step: 1

include include using namespace std void getJudgeDatadouble ... 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

Document Format ( 2 attachments)

PDF file Icon
609474c272067_24864.pdf

180 KBs PDF File

Word file Icon
609474c272067_24864.docx

120 KBs Word File

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

Fundamentals of Physics

Authors: Jearl Walker, Halliday Resnick

8th Extended edition

471758019, 978-0471758013

More Books

Students also viewed these Programming questions

Question

Calculate the indirect quotations for Euros and Kronor.

Answered: 1 week ago

Question

Define the steps involved in the right way to buy a business. p-698

Answered: 1 week ago

Question

6.65 Find the probability that z lies between z=-1.48 and z=1.48.

Answered: 1 week ago

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago