C++ While loop
While Loops Lab
Write a program that does the following:
- Prompts the user for the number of grades they wish to enter.
- Computes a running total of the grades entered.
- Calculates the average of the grades entered.
- Test to make sure the average is not computed if the number of grades is zero.
- Prints out a message stating the average of the grades entered.
Include the following:
1. Initialize the counter to either zero or one before the while loop begins.
2. Use a counter controlled while loop that uses the number of grades entered by the User as the maximum number of loops executed.
a. If you initialized your counter to zero you will want the loop to continue as long as your counter is less than the number of grades.
b. If you initialized your counter to one you will want the loop to continue as long as your counter is less than or equal to the number of grades.
3. Within the body of the loop:
a. Prompts the User for the next grade.
b. Compute a running total of these grades as they are entered.
4. After the While Loop is done executing, compute the average of all the grades entered. Remember to check to make sure you don't perform a division by zero.
13 years ago
10
Purchase the answer to view it

- grades_using_while.c
Purchase the answer to view it

- grade.docx
Purchase the answer to view it

- source2.cpp
- MKT 571 Complete Course (All DQ'S,Assignments and Presentations) + Final EXAM !!
- PERFORMANCE MEASURES
- FIN 571 Complete Course (All DQ'S And Assignments) + Final EXAM !!
- Geniusy; Will you help me with my ACC 201 Assignment 1 and 2 plus dq ?
- Calculate the energy in the form of heat (in kJ) required to change 75.0 g of liquid water at 27.0...
- BUS 640 Managerial Economics - Week 1 Discussion
- BUS 599 Week 2 Assignment Competitive Forces and SWOT Analysis Case Whole Foods Market
- Regional
- SOCIOLOGY VERY URGENT HOMEWORK HELP NEEDED
- NTC 362 Entire Class (Completed with 98% Marks)