1. Write a program that calculates the average of four test scores, where the lo
ID: 3631688 • Letter: 1
Question
1. Write a program that calculates the average of four 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, validate its value and then return the value back to the function that called it. Scores should not be lower than 0 or higher than 100. This function should be called by the main function once for each of the four scores to be entered. For every call, the main function should save the return value of getScore using a variable.
? void calcAverage() should calculate and display the average of the three highest scores. This function should be called only once by the main function, and should accept the four scores as function parameters.
? int findLowest() should find and return the lowest of the four scores to be passed to it. It should be called by calcAverage, which uses this function to determine which of the four scores to drop.
Explanation / Answer
#include #include using namespace std; const int SCORES = 5; void getscore(int score[], int iElements = SCORES); int findLowest (int score[]); void calcAverage (double&, int score[]); int score_main() { double average; int score[5]; getscore (score); calcAverage (average, score); coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.