Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions