Question: Write a C++ program that will calculate the average of a group of test scores, where the lowest score in the group will be dropped.
Write a C++ program that will calculate the average of a group of test scores, where the lowest score in the group will be dropped. The program should use the following functions: void getScores - will display a program output header (see output shown below) and then will ask the user to enter five test scores, calling the function readScore (see below), and then return the five scores to main using call-by-reference parameters int readscore - will ask the user to enter one score and validate the score, requiring the user to re- enter the score as long as it is invalid. Note: A valid score is an integer between 0 and 100. float calcaverage - will receive the five scores from main and will calculate and return the average of the top four scores. This function will call the function findlowest (see below) to determine the lowest score. int tandlowest - will receive the five scores and will return the lowest of the five scores. The main function will be the program driver, calling the above functions to handle input of scores, calculation and display of the average, and display of the dropped score. Program requirements: a. The only function that may contain a cin statement is readScore. b. The only functions that may contain a cour statement are getScores, readScoreand main c. Do not use any global variables. Output from a sample program run (user input in bold) Teat Score Average Program Enter score (0-100): 90 Enter score (0-100): 60 Enter score (0-100): 50 Enter score (0-100): 80 Enter score (0-100): 70 Average = 75 Dropped score = 50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
