Question: Write a C++ program that asks the user to enter a students grades on three exams and then averages them. Your program should have the
Write a C++ program that asks the user to enter a students grades on three exams and then averages them. Your program should have the following functions:
getScore: Asks the user to enter one test score. If the score is invalid (less than 0 or greater than 100), ask the user to re-enter the score. Once a valid score is entered, return it. calculateAverage: Takes three test scores as arguments. It calculates the average score and returns it. Your main function should call getScore three times, assigning the return value of each call to one of three different variables. It should then call calculateAverage, pass those three variables, and print the average returned by calculateAverage.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
