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 cycles. Set random to return an integer value from to using math.random Create a onedimensional array to store the count of each randomly generated value. This can be done by adding one to the data stored in the appropriate index, which represents the random value. For example, when the number one is generated, add one to the value in arrayName When the number two is randomly generated, add one to the value in arrayName and so on We will ignore arrayName 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 So a value of would print out 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
