Question
6. One interesting application of computers is the drawing of graphs and bar charts (sometimes called histograms). Write a modular program that performs the following:
6. One interesting application of computers is the drawing of graphs and bar charts (sometimes called "histograms"). Write a modular program that performs the following: (25 points) a. Take a user input representing a number of positive integer values (n) that the program will process. This number (n) should be greater than 0 and not more than 20. b. Draw a header for the results, as shown in the example below. c. Take each positive integer value one by one to print a line containing the read value (on two positions), followed by a space and then a number of adjacent '#'s equal to the integer read value. Each entered integer value should be greater than 0 and not more than 15. d. Print a footer showing some statistical results: the average of the (n) entered values (rounded to the nearest integer), the highest value, the lowest value, and the number of values below 5. e. The following is just an example of the program output for n = 10 and the values entered one by one for processing are 5, 10, 2, 7, 7, 15, 9, 3, 12, and 2. ============================= Number of Values: 10 Results: ------------------------------------------------- 5 ##### 10 ########## 2 ## 7 ####### 7 ####### 15 ############### 9 ######### 3 ### 12 ############ 2 ## ------------------------------------------------- Average = 7 Highest Value = 15 Lowest Value = 2 Number of Values Below 5 = 3 =============================
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started