Problem Description

Write a C++ program that reads a set of integers from the standard input stream. Your program should determine the number of values in each of the following ranges: [0,24], [25,49], [50,74], [75,99], [100,124], [125,149], [150,174], and [175,200]. (Each range is inclusive.)

Specific program requirements

Your program must be modular in design. Programs with only a main function will receive a score of 0. The main function body should be no more than 20 lines.

Input specification

Input consists of 0 or more integer values. White space separates values. Input is terminated by end of file. Values falling outside the range [0,200] should be discarded.

Output specification

Output consists of a table with column headings, eight detail lines, and a summary line. Each detail line consists of a range, the count of values in that range, the percentage this range overall (rounded to the nearest whole number), and a histogram of the percentage.Following the table is one blank line followed by the summary line with total count and percentage. Each line is terminated with a newline character. (See sample output for a detailed example.)

Sample input

110 87 89 103 85 69 90 101 97 152 67 63 95 136 139 124 79 88 141 113 73 91 112 110 75 120 61 100 87 0 200 -1 201 142 173 25 37 49 70.173.106.164

Sample output

Range Count Perct Histogram
[ 0, 24] 1 3% ***
[ 25, 49] 3 8% ********
[ 50, 74] 5 14% **************
[ 75, 99] 11 31% *******************************
[100,124] 9 25% *************************
[125,149] 4 11% ***********
[150,174] 2 6% ******
[175,200] 1 3% ***

Total 36 100%
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.