Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++, Programming Challenge: 11 - Lowest Score Drop To encourage code re-use, use data type double for all scores. That means that the return

In C++,

image text in transcribed

Programming Challenge: 11 - Lowest Score Drop

To encourage code re-use, use data type double for all scores. That means that the return type of findLowest() will be double, not int. The findLowest() and findHighest()functions accept five parameters of type double.

Write a separate function for validation that returns true if the value is in the given range, and false otherwise

The getScore() function should call the validation function to validate scores. Note that the getScore() function has only one parameter, a reference to a double. This function does not return a value.

You will be able to use the same findLowest() function for both this and the next Programming Challenges. Also note that the getScore() function in this challenge and the getJudgeData() function in the next one are exactly the same other than the name. You will finally get a chance to re-use some code!

Show results with exactly two digits after the decimal point.

Do not make use of arrays in this program; that will be in a future assignment.

Main has been provided below. Should be used exactly as is.

int main(){ double score1, score2, score3, score4, score5; getScore(score1); getScore(score2); getScore(score3); getScore(score4); getScore(score5); calcAverage(score1, score2, score3, score4, score5); return 0; }
11. Lowest Score Drop Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: - void getScore () should ask the user for a test score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of the five scores to be entered. - void calcAverage ( ) should calculate and display the average of the four highest scores. This function should be called just once by main and should be passed the five scores. - int findLowest () should find and return the lowest of the five scores passed to it. It should be called by calcAverage, which uses the function to determine which of the five scores to drop. Input Validation: Do not accept test scores lower than 0 or higher than 100

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

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

how would you have done things differently?

Answered: 1 week ago

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago