Question: Lowest Score Drop - C++ In Functions, there can only be one return statement. You can not use an exit or break function. Write a
Lowest Score Drop - C++
In Functions, there can only be one return statement. You can not use an exit or break function.
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 6 scores to be entered. Use a local static variable for which score is to be entered.
void calcAverage() should calculate and display the average of the five highest scores. This function should be called just once by main and should be passed the six scores. Include 2 decimal places on the result. This is passed data by value.
double findLowest() should find and return the lowest of the six scores passed to it. It should be called by calcAverage, which uses the function to determine which of the six scores to drop. This is passed data by value.
Do not use the min or max C++ functions.
Sample Run:
Enter test 1: 90 Enter test 2: 85 Enter test 3: 65 Enter test 4: 75 Enter test 5: 70 Enter test 6: 80 The average of the top 5 tests: 80.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
