[Solved]Java Part 1 Write Java Program Generate 200 Random Integers Range 0 999 Inclusive Find Ap Q37085672
JAVA.
Part 1.
Write a Java program to generate 200 random integers in therange of 0 and 999 (both inclusive). Then find the appearancefrequency of each digit (0-9) in these numbers, and print afrequency histogram.
Detailed Instructions
-
Write this program using an array
-
Use switch statements for digit frequency counting.
-
When you split an integer, make sure you get all 3 digits. Forexample:
number digit1 digit2 digit3 402 4 0 2 75 0 7 5 6006 900 9 00
Hint: use integer division and modulus operations.
-
For each digit from 0 to 9:
• Display the digit and the frequency count.
• Display the horizontal frequency bar of asterisks using a forloop.For example, digit 5 with a frequency count 28 will display abar like this:
5 (28): ****************************
-
Every time your program runs, it should generate differentrandom numbers and different results.
Expected Frequency Analysis
Perform a formal mathematical analysis on the expected digitfrequencies. What is the expected frequency of each digit (0-9) ifwe generate 200 random integers between 0 and 999?
Expert Answer
Answer to JAVA. Part 1. Write a Java program to generate 200 random integers in the range of 0 and 999 (both inclusive). Then find… . . .
OR

