Question: Write a program that calculates the average of three test scores. The program should contain three value-returning functions: main, getTestScore, and calcAverage. The main function
Write a program that calculates the average of three test scores. The program should contain three value-returning functions: main, getTestScore, and calcAverage. The main function should call the get TestScore function to get, validate the score to make sure the value is between 0 and 100, and return each of the three test score. The testscore may contain a decimal place. (Hint: the main function will need to call the getTestScore function three times.) The main function then should call the calcAverage function to calculate and return the average of the three test scores. When the calAverage function has completed its task, the main function should display the average on the screen Submit a copy of the program (30 points) and a copy of the program output for different data sets. Make sure you include output for invalid test scores (10 points). /function prototypes float getTestScore ; float calcAverage(float scorel, float score2, float score3); int main) float s1,s2, s3; //these variable are used to store test scores float average //call getTestScore function to get the test scores s1 = getTestScore(); s2- getTestScoreO s3- getTestScoreO; icall calcAverage to calculate the average of three test scores average calcAverage(s1, s2, s3) ili display the average cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
