Write a C++ program that calculates the average, minimum, and maximum test scores for a list of scores between 0 and 100 provided by the user. The program should first prompt the user for the number of tests in the list and then prompt for each score. For any score that does not fall between 0 and 100, the program should display an error and prompt for re-input. The calculated numbers should have one decimal point. The program should use while loops. Use the menu and prompt formats exactly as provided in the sample output below.
1. Your output should be formatted to look exacly as the following:
1. For all valid inputs:
“`
Enter the number of tests : 5
Enter test score (0 – 100): 93
Enter test score (0 – 100): 87
Enter test score (0 – 100): 76
Enter test score (0 – 100): 89
Enter test score (0 – 100): 94
******** RESULTS ********
Number of tests: 5
Average score : 87.8
Minimum score : 76.0
Maximum score : 94.0
“`
1. For an invalid test score:
“`
Enter the number of tests : 2
Enter test score (0 – 100): -1
Score out of range, try again: 90
Enter test score (0 – 100): 70
******** RESULTS ********
Number of tests: 2
Average score : 80.0
Minimum score : 70.0
Maximum score : 90.0
“`
1. For an invalid number of tests:
“`
Enter the number of tests : 0
Number of tests must be grater than 1.
Write a C++ program that calculates the average, minimum, and maximum test scores for a list of scores between 0 and 100 provided by the user. The program should first prompt the user for the number of tests in the list and then prompt for each score. For any score that does not fall between 0 and 100, the program should display an error and prompt for re-input. The calculated numbers should have one decimal point. The program should use both for and while loops. Use the menu and prompt formats exactly as provided in the sample output below.Your output should be formatted to look exacly as the following:
1. For all valid inputs:
“`
Enter the number of tests : 5
Enter test score (0 – 100): 93
Enter test score (0 – 100): 87
Enter test score (0 – 100): 76
Enter test score (0 – 100): 89
Enter test score (0 – 100): 94
******** RESULTS ********
Number of tests: 5
Average score : 87.8
Minimum score : 76.0
Maximum score : 94.0
“`
1. For an invalid test score:
“`
Enter the number of tests : 2
Enter test score (0 – 100): -1
Score out of range, try again: 90
Enter test score (0 – 100): 70
******** RESULTS ********
Number of tests: 2
Average score : 80.0
Minimum score : 70.0
Maximum score : 90.0
“`
1. For an invalid number of tests:
“`
Enter the number of tests : 0
Number of tests must be grater than 1.“`
Our Advantages
Plagiarism Free Papers
All our papers are original and written from scratch. We will email you a plagiarism report alongside your completed paper once done.
Free Revisions
All papers are submitted ahead of time. We do this to allow you time to point out any area you would need revision on, and help you for free.
Title-page
A title page preceeds all your paper content. Here, you put all your personal information and this we give out for free.
Bibliography
Without a reference/bibliography page, any academic paper is incomplete and doesnt qualify for grading. We also offer this for free.
Originality & Security
At Homework Valley, we take confidentiality seriously and all your personal information is stored safely and do not share it with third parties for any reasons whatsoever. Our work is original and we send plagiarism reports alongside every paper.
24/7 Customer Support
Our agents are online 24/7. Feel free to contact us through email or talk to our live agents.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
We work around the clock to see best customer experience.
Pricing
Our prices are pocket friendly and you can do partial payments. When that is not enough, we have a free enquiry service.
Communication
Admission help & Client-Writer Contact
When you need to elaborate something further to your writer, we provide that button.
Deadlines
Paper Submission
We take deadlines seriously and our papers are submitted ahead of time. We are happy to assist you in case of any adjustments needed.
Reviews
Customer Feedback
Your feedback, good or bad is of great concern to us and we take it very seriously. We are, therefore, constantly adjusting our policies to ensure best customer/writer experience.