Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedJava

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

Explain the contribution of Peter F. Drucker to Management .

Answered: 1 week ago

Question

What is meant by organisational theory ?

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago