Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a complete C++ program called average.cpp that does the following. First it reads three integers and reports the median of those three integers. Next,

Write a complete C++ program called average.cpp that does the following.

  1. First it reads three integers and reports the median of those three integers.

  2. Next, it reads integers until it reads 1. It reports the mean of all of those integers, excluding the 1 at the end.

Example 1

If the input is

 3 9 5 4 5 8 20 25 -1 

then your program should say:

 The median of (3, 9, 5) is 5. The mean of (4, 5, 8, 20, 25) is 12.40 

Example 2

If the input is

 3 6 3 2 4 6 -1 

then your program should say:

 The median of (3, 6, 3) is 3. The mean of (2, 4, 6) is 4.00.

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 Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

3. Evaluate your listeners and tailor your speech to them

Answered: 1 week ago