Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In programming assignment 12, you wrote a method that would run a single round of a random walk and return the number of steps that

In programming assignment 12, 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 start 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.

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

Students also viewed these Programming questions

Question

Evaluate common feachers of social reform movement in Kerala?

Answered: 1 week ago

Question

Name the biggest tragedy in Malabar rebellion?

Answered: 1 week ago

Question

Write a short note on khan Abdul ghafar khan ?

Answered: 1 week ago

Question

Prepare a short note on dandi March ?

Answered: 1 week ago

Question

Famous slogan in India?

Answered: 1 week ago