Question
NEED WITHIN ONE HOUR OF POSTING C++ 1) Write a program that calculates the average of a group of five test scores, where the lowest
NEED WITHIN ONE HOUR OF POSTING C++
1) Write a program that calculates the average of a group of five test scores, where the lowest score in the group is dropped. It should use the following functions:
int getScore() should ask the user for a test score, store it in a variable, and validate that it is not lower than 0 or higher than 100. This function should be called by the 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 the 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 one of the five scores to drop.
Format the output in two columns and round off all real numbers to two decimal places.
When you run your program, your output should look like this one:
Enter a test score between 0 and 100: 98
Enter a test score between 0 and 100: 97
Enter a test score between 0 and 100: 95
Enter a test score between 0 and 100: 99
Enter a test score between 0 and 100: 91
The lowest grade (to be dropped): 91.00
The total (after dropping the lowest grade): 389.00
The average (after dropping the lowest grade): 97.25
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started