Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that will read in a sorted list of at most100 positive floating point numbers and will display the total number of

Write a C++ program that will read in a sorted list of at most100 positive floating point numbers and will display the total number of positive numbers entered and their median.

Notes:

  1. The median value of a list of numbers sorted in order from smallest to largest is the middle value of the numbers entered if the total number entered is odd; otherwise, the median is the average of the two middle values of the numbers entered. For example, the median of 1,2,3,4,5 is 3 (the middle value), while the median of 1,2,3,4,5,6 is 3.5 (the average of the two middle values).
  2. Assume the numbers entered are sorted in order from smallest to largest.
  3. Do not assume that the user knows the number of numbers to be entered in advance of entry.

Here is output from a sample run of the program (user input in bold):

Enter positive float #1: 2

Enter positive float #2 (0 to stop): 4

Enter positive float #3 (0 to stop): 6

Enter positive float #4 (0 to stop): 8

Enter positive float #5 (0 to stop): 0

Total number of numbers entered = 4

Median = 5

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

2. What type of team would you recommend?

Answered: 1 week ago

Question

What is meant by 'Wealth Maximization ' ?

Answered: 1 week ago