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
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