Use of Single-dimension Arrays Write a program that will store 200 integer values in a single-dimension array. The values stored in the array must be randomly generated by the program and be in the range of 1 to 10. The program will: a. Display to the monitor all integer values in table format of 10 rows and 20 columns. b. Calculate and display the total sum of the numbers stored in the array. c. Calculate and display the final average of the numbers stored in the array. d. The number of times each value stored in the array occurred. There are several ways to do this step; and you're allowed to create a second array for this part if it helps. e. Displays a histogram of the value occurrences. The following sample output is for 60 random integers values generated by the computer: 4 10 79 52239 9 10 7 10 The sum of all values is: 345 The average is: 5.75 Occurrence of each value. 1 appeared The value The value The value The value The value The value The value The value 2 appeared 3 appeared 4 appeared 5 appeared 6 appeared 7 appeared & appeared The value 9 appeared The value 10 appeared lue 5: alue 7: Value 8: Value 9: Value 10: 6 times. 3 times. 5 times. 7 times. 1 times. 8 times. 7 times. 9 times. 6 times. 1 10 Process returned (exe) execution time: 0.048 s Press any key to continue.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Write a program that will store 200 integer values in a single-dimension array. The values stored in the
array must be randomly generated by the program and be in the range of 1 to 10. The program will:


a. Display to the monitor all integer values in table format of 10 rows and 20 columns.
b. Calculate and display the total sum of the numbers stored in the array.
c. Calculate and display the final average of the numbers stored in the array.
d. The number of times each value stored in the array occurred. There are several ways to do
this step; and you're allowed to create a second array for this part if it helps.
e. Displays a histogram of the value occurrences.  

I am stuck on d and e attache is the Hw file and how far i got in the code.

# Use of Single-dimension Arrays

## Objective
Develop a program that stores 200 integer values in a single-dimension array. The array values should be generated randomly within the range of 1 to 10. The program will execute the following tasks:

### Tasks:
1. **Display Values**  
   - Show all integer values in a table format with 10 rows and 20 columns.

2. **Calculate Sum**  
   - Compute and display the total sum of the numbers in the array.

3. **Calculate Average**  
   - Compute and display the final average of the numbers stored in the array.

4. **Count Occurrences**  
   - Determine and display how many times each value appears in the array. Multiple methods exist for accomplishing this task; using a secondary array is permissible if beneficial.

5. **Histogram Display**  
   - Present a histogram showing the frequency of each value.

### Sample Output:
The sample output illustrates the program's execution for 60 random integers.

- **Values Generated:**
  ```
  6 5 2 9 1 1 6 7 9 7 1 9 3 9 7 8 4 8 3 1
  7 10 10 8 8 6 8 10 8 7 9 2 2 7 7 4 7 7 10 5
  6 2 4 9 4 8 7 1 6 5 6 9 8 6 5 4 1 5 6 9
  ```
  
- **Sum and Average:**
  ```
  The sum of all values is: 345
  The average is: 5.75
  ```

- **Occurrence of Each Value:**
  ```
  The value 1 appeared 6 times.
  The value 2 appeared 4 times.
  The value 3 appeared 2 times.
  The value 4 appeared 6 times.
  The value 5 appeared 4 times.
  The value 6 appeared 8 times.
  The value 7 appeared 9 times.
  The value 8 appeared 8 times.
  The value 9 appeared 7 times.
  The value 10 appeared 6 times.
  ```

- **Histogram:**
  ```
  Value 1 : ******
Transcribed Image Text:# Use of Single-dimension Arrays ## Objective Develop a program that stores 200 integer values in a single-dimension array. The array values should be generated randomly within the range of 1 to 10. The program will execute the following tasks: ### Tasks: 1. **Display Values** - Show all integer values in a table format with 10 rows and 20 columns. 2. **Calculate Sum** - Compute and display the total sum of the numbers in the array. 3. **Calculate Average** - Compute and display the final average of the numbers stored in the array. 4. **Count Occurrences** - Determine and display how many times each value appears in the array. Multiple methods exist for accomplishing this task; using a secondary array is permissible if beneficial. 5. **Histogram Display** - Present a histogram showing the frequency of each value. ### Sample Output: The sample output illustrates the program's execution for 60 random integers. - **Values Generated:** ``` 6 5 2 9 1 1 6 7 9 7 1 9 3 9 7 8 4 8 3 1 7 10 10 8 8 6 8 10 8 7 9 2 2 7 7 4 7 7 10 5 6 2 4 9 4 8 7 1 6 5 6 9 8 6 5 4 1 5 6 9 ``` - **Sum and Average:** ``` The sum of all values is: 345 The average is: 5.75 ``` - **Occurrence of Each Value:** ``` The value 1 appeared 6 times. The value 2 appeared 4 times. The value 3 appeared 2 times. The value 4 appeared 6 times. The value 5 appeared 4 times. The value 6 appeared 8 times. The value 7 appeared 9 times. The value 8 appeared 8 times. The value 9 appeared 7 times. The value 10 appeared 6 times. ``` - **Histogram:** ``` Value 1 : ******
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education