Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

cs 141 java Random Numbers 2 A Submit Assignment Due Wednesday by 11:59pm Points 5 Submitting a file upload File Types java and zip In

image text in transcribedcs 141 java

Random Numbers 2 A Submit Assignment Due Wednesday by 11:59pm Points 5 Submitting a file upload File Types java and zip In Random Numbers 1 you wrote a method that would run a single round of a random walk and return the number of steps that it took for the walk to end. For example a walk to 10 might take anywhere from 10 to 200 or more steps. Your question on this assignment is to take that method, and to determine the AVERAGE number of steps it takes. To do this you are going to run your method from the first program 10000 times, and find the total number of steps needed and then divide it to find the average. So for example If I ask the computer what is the average number of steps for a size 20 walk, it might return back that the average number of steps is 397.33 So you need to ask the user what size walk they want to know about, then run the method with that number 10,000 (ten thousand) times, and find the average number of steps. Then print out that number. A sample of what your output should look like: ----GRASP exec: java ProgramNumber12 What size walk do you want to test? 100 For a walk of size 100, after 10.000 tries, on average it took 10029.12 steps to get there. ----GRASP: operation complete

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

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago