Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ please B. do-while loop In this lab exercise, we will practice a do-while loop. Your program needs to compute the average of grades
In C++ please
B. do-while loop In this lab exercise, we will practice a do-while loop. Your program needs to compute the average of grades inside a do-while loop. Your program needs to check if the entered grade is in the correct range before using it for computation. If the entered grade is less than 0 or greater than 100, inform the user that the grade is incorrect and repeat the loop. You do not know how many grades the user will eventually enter. Hence, after entering each correct grade, ask the user if there is another grade to be entered. Get the user response using a character variable. If the user enters 'Y' or 'y', let the user enter another grade by repeating the loop, otherwise terminate the loop and display the average. Keep track of how many correct grades were entered so that you can compute the average. Complete the requested changes, and then save the file as Lab5B.cpp, making sure to compile and run the program to verify that it produces the correct results. Note that you will submit this file to CanvasStep 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