Question: Objective: Learn how to - use the counter-controlled while loop -- use the sentinel-controlled while loop -- perform accumulation -- handle errors -- use formatted

 Objective: Learn how to - use the counter-controlled while loop --

Objective: Learn how to - use the counter-controlled while loop -- use the sentinel-controlled while loop -- perform accumulation -- handle errors -- use formatted output-fixed with two digits after decimal place Problem: Write a C++ program to calculate and output the average of a set of in integer marks ending with 999. The program should output the number of marks processed for each test case. The program should ignore invalid marks and an appropriate message should be printed. Valid marks are marks between 0-100. If no marks are processed, an appropriate message should be printed. The average should be printed as a fixed point with two places after the decimal. Suggested screen design: (On Next Page) HOH many test cases: 3 Test Cage 1 Input Integer (999 to End): 75 Input Integer to End) 56 Input Integer (999 to End): 89 Input Integer (999 to End): 120 120 is an invalid sark. Input Integer (999 to End) -75 - 75 in an invalid mark. Input Integer (999 to End): 74 Input Integer (999 to End): 999 The average is: 73.50 There were 4 marks processed Test Case 2: Input Integer (999 to End): 999 No marko processed. Test Case 3: Input Integer (999 to End): 0 Input Integer (999 to End) Input Integer (999 to End): 0 Input Integer (999 to End): 999 The average is: 0.00 There were 3 marks processed. Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!