Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program is C++, and should look as same as the sample output Exercise Two: (Average of 3 numbers with repetition) Ask the user to

The program is C++, and should look as same as the sample output

image text in transcribed

Exercise Two: (Average of 3 numbers with repetition) Ask the user to enter 3 numbers. Write a program that averages them and display them up to 2 decimal points, if it has more than 2 decimal number. Then ask the user if s/he wants to average another set? if the user enters y or Y, consider it as yes. Any other input, consider it as no. Expected output: Enter your first number: 12 Enter your second number: 12 Enter your Third number: 13 Average of 12,12, and 13 is= 12.33 Do you want to average another set? (Y/N): y Enter your first number: 80 Enter your Second number: 90 Enter your Third number: 70 Average of 80,90, and 70 is= 80 Do you want to average another set? (Y/N): Y Enter your first number: 60 Enter your Second number: 75 Enter your Third number: 88 Average of 60,75, and 88 is= 74.33 Do you want to average another set? (Y/N): n Thanks for using this program! Your output must match with my output. If there is a line gap in the middle of 2 lines, your output should have the same line gap, same place. Your code must run as long as the user is entering Yory. Your code must display "Thanks for using this program!" when the user enters nor any other letter. The decimal number must display up to 2 decimal points. Exercise Three: This exercise is the repetition of Exercise-Two with a change. In this exercise, Ask the user, how many numbers you want to average? Input Validation: This number can't be less than two (since you can't do the average of one number). Then ask the user to enter that many numbers. . Once you get all the input, show the average of them to the screen. I am showing the sample output here for a clear understanding. Feel free to design the output in your way. Here we are not repeating the code for another set of numbers. Don't worry about formatting the decimal number. Sample Output: How many numbers do you want to average? 1 Count must be more than 1, Enter again: -3 Count must be more than 1, Enter again: 4 Enter number 1 : 23 Enter number 2 : 22.5 Enter number 3 : 43 Enter number 4 : 12.99 The average is 25.3725 Thanks for using this program

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

Step: 3

blur-text-image

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago