Question: Objective This assignment will demonstrate the process of programming with the basic three structures, arrays and methods. Also, let s answer the question: How good

ObjectiveThis assignment will demonstrate the process of programming with the basic three structures, arrays and methods. Also, lets answer the question: How good is Javas random generator? Only use statements taught in your book.DescriptionOne way of testing a random generator is to test the distribution. In an infinite set of values, every value should be evenly generated. For this example, well also calculate the difference between each values percentage.Design and write a Java program that counts the number of values the math.random andom generator creates over 100,000 cycles. Set random to return an integer value from 1 to 10.(using math.random) Create a one-dimensional array to store the count of each randomly generated value. This can be done by adding one (1) to the data stored in the appropriate index, which represents the random value. For example, when the number one (1) is generated, add one (1) to the value in arrayName[1]. When the number two (2) is randomly generated, add one (1) to the value in arrayName[2] and so on. We will ignore arrayName[0], because it is not part of our random numbers. We will also draw a histogram of the results. In the sample run, each asterisk * represents a 1,000. So, a value of 10,000 would print out 10 asterisks. (We cannot draw a fraction of an asterisk!) The columns in the output must align.You must use the following methods:main() contains the basic program and control.displayData accepts the array as an argument and builds the output as shown in the sample run.
Objective This assignment will demonstrate the

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 Programming Questions!