Question: There is a clock that ticks once per second. With each tick of the clock, your program should use function moveTortoise and moveHare to adjust
There is a clock that ticks once per second. With each tick of the clock, your program should use function moveTortoise and moveHare to adjust the position of the animals according to the rules in the table below at the end of the question. These functions should use pointerbased passbyreference to modify the position of the tortoise and the hare.
Use variables to keep track of the positions of the animals ie position numbers are Start each animal at position ie the starting gate If an animal slips left before square move the animal back to square
Generate the percentages in the preceding table by producing a random integer i in the range i For the tortoise, perform a fast plod when i a slip when i or a slow plod when i Use a similar technique to move the hare.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
