Question: Java Create a class named H3_Q2.java to accomplish the following tasks. a. Add a loop that generates 10,000 discrete random numbers betweewn a = 10

Java Create a class named H3_Q2.java to accomplish the following tasks. a.Add a loop that generates 10,000 discrete random numbers betweewn a =Java

Create a class named H3_Q2.java to accomplish the following tasks. a. Add a loop that generates 10,000 discrete random numbers betweewn a = 10 and b = 100. The formula for generating a discrete uniform random number is DU(a,b) = [U(0, 1) (b a +1)] +a where a and b are integers, a 5 b, ) is the floor operator and U(0,1) is a uniform random variable between 0 and 1 (hint: we generated U(0, 1) values in class). b. For the 10,000 random numbers generated in a., add code that counts the total number of times that the random value generated is in either of the following ranges: (0,2] or [16,44]. Print this total to the screen with an appropriate label. c. Write a loop the continues to generate random floating-point numbers between 0 an 1 until the random value generated exceeds 0.9. Write every value generated to an output file named Q2cOutput.txt located in a directory named output_files. Print out the number of times the loop was executed to the same file with an appropriate label. Create a class named H3_Q2.java to accomplish the following tasks. a. Add a loop that generates 10,000 discrete random numbers betweewn a = 10 and b = 100. The formula for generating a discrete uniform random number is DU(a,b) = [U(0, 1) (b a +1)] +a where a and b are integers, a 5 b, ) is the floor operator and U(0,1) is a uniform random variable between 0 and 1 (hint: we generated U(0, 1) values in class). b. For the 10,000 random numbers generated in a., add code that counts the total number of times that the random value generated is in either of the following ranges: (0,2] or [16,44]. Print this total to the screen with an appropriate label. c. Write a loop the continues to generate random floating-point numbers between 0 an 1 until the random value generated exceeds 0.9. Write every value generated to an output file named Q2cOutput.txt located in a directory named output_files. Print out the number of times the loop was executed to the same file with an appropriate label

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