Question: Please write code in java ! Array size 1 0 Several valid approaches exist to code this assignment; the pseudocode below stores integers in the

Please write code in java !
Array size 10
Several valid approaches exist to code this assignment; the pseudocode below stores integers in the histogram-array that represent the number of times a random digit was generated corresponding to the index of histogram-array. For example, a '14' in the zeroth element of the histogram-array indicates that the digit '0' was randomly generated fourteen times.
Get a user-defined seed.
Create a random object using a user-defined seed.
Get the number of user-defined data points.
Using a loop, initialize the histogram-array with zeros in all elements.
Note: This is not necessary for an array that stores the primitive-int values since, by default, all elements of an array that store the primitive-int data type are initialized to zero.
Using a loop, update the histogram-array with integers that represent the number of occurrences (counter) of a random digit corresponding to the histogram-array index.
For example:
If the first random digit is a 6, then increment the value in the sizth element by one: 01.
If the second random digit is a 0, then increment the value in the zeroth element by one: 0-->1.
If the third random digit is a 9, then increment the value in the ninth element by one: 0-->1.
If the fourth random digit is a 6, then increment the value in the sizth element by one: 1->2.
If the fifth random digit is a 6, then increment the value in the sizth element by one: 2-->3.
If the sixth random digit is a 0, then increment the value in the zeroth element by one: 1-->2.
etc.
Using a loop, display
the histogram-array index (corresponding to a random digit) for the current index followed by
a sequence of dashes (using an inner-loop [nested loops]) that correspond to the number of occurrences of the histogram-array current index followed by
the integer that corresponds to the number of occurrences of the histogram-array current index.
For example:
if the eighth element stores a 3, then you need to print 8, followed by three dashes and the integer three.
Please write code in java ! Array size 1 0

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!