Question: In processing averages for scientific data, it is common to remove the highest and lowest values before calculating an average or a mean. This is

In processing averages for scientific data, it is common to remove the highest and lowest values before calculating an average or a mean. This is to remove extreme values that might distort the true average. Those values may represent measurement errors, data entry or processing errors, or poor data sampling. Your local mad scientist plans to build a secret liar underground to protect his crew from cosmic and other radiation. We will be calculating the average of several measurements of radiation levels below the earth's surface at various locations but the same depth.Problem DescriptionAs one of the minions of the local mad scientist, you're tasked with creating a C++ program that will calculate an average of several values but without the highest two values and without the lowest two values. The program should calculate and display the following essential statistics:Total count of measurements ( including the extremes )The highest 2 measurementThe lowest 2 measurementThe average measurement - not including the highest 2 and lowest 2 measurements.Input DescriptionThe program should read a series of positive numbers representing the depth the measurements were taken, as well as the measurements themselves from standard input (cin). No single measurement will exceed $1E6. The series ends when a sentinel value (-1) is encountered. Note that the sentinel value (-1) itself should not be included in the calculations.Output DescriptionDisplay the calculated statistics for the entered expenses in a well-structured table format. The table should have a name, and each column should have a header (column title). The right column should be right-aligned to ensure proper formatting. See Sample Interaction for an example of the expected table format.Sample Interaction (using cin and cout)$ echo 102015.77.4212.3415.75.60-1|./pa05Radiation Analysis| Statistic | Value ||--------------------------------|-----------|| Depth of measurements (meters)|10|| Number of measurements |6|| Top Two Highest Measurements |20.00|||15.70|| Bottom Two Lowest Measurement |5.60|||7.42|| Average without the extremes |14.02|$ cat pa05-input0.txt102015.77.4212.3415.75.60-1$ ./pa05< pa05-input0.txt Radiation Analysis| Statistic | Value ||--------------------------------|-----------|| Depth of measurements (meters)|10|| Number of measurements |6|| Top Two Highest Measurements |20.00|||15.70|| Bottom Two Lowest Measurement |5.60|||7.42|| Average without the extremes |14.02|Specific Program RequirementsEnsure that your program adheres to the concepts and features introduced in the chapters covered by the course textbook. Usage of any C++ features or libraries not yet introduced in the assigned chapters is not permitted and may result in a zero score for the assignment. Make sure to use vectors.Utilize a repetition structure (e.g., for, while, or do..while loops) to read a series of positive numbers until the sentinel value (-1) is encountered.Calculate and display the total count, sum, average expense per item, top two highest expenses, and bottom two lowest expenses from the entered expenses.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!