Computers and Technology

Write a program that simulates an ant trying to crawl up a building of certain height. The ant starts on the ground, at height 0. Each iteration, the ant either crawls up one step, or slips off and falls all the way back to the ground. There is a 50% chance on each iteration that the ant will slip. The program should keep going until the ant gets to the top of the building. It should then print out the number of falls that the ant took before it finally reached the top.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:00, floydsidney1119
Think about some of the most memorable and forgettable games ever created. they can be games that were discussed in this unit or otherwise. what are some of the consistent factors that made certain games memorable to you? what were some of the consistent factors that made certain games forgettable to you? why? explain.
Answers: 1
image
Computers and Technology, 22.06.2019 03:40, plzhelpmeasap46
Hello my name is mihai and i need your : )i have to do a python project in computer science and i’m really busy with my mocks this period of time besides this i’m not good at coding so could someone pls pls pls sort me out ? i actually beg ; ))
Answers: 1
image
Computers and Technology, 23.06.2019 01:00, leo4687
Complete the sentence about a presentation delivery method
Answers: 2
image
Computers and Technology, 23.06.2019 18:40, cyn95xx
Johnson enterprises uses a computer to handle its sales invoices. lately, business has been so good that it takes an extra 3 hours per night, plus every third saturday, to keep up with the volume of sales invoices. management is considering updating its computer with a faster model that would eliminate all of the overtime processing.
Answers: 2
Do you know the correct answer?
Write a program that simulates an ant trying to crawl up a building of certain height. The ant start...

Questions in other subjects:

Konu
Mathematics, 24.09.2019 07:30
Konu
Social Studies, 24.09.2019 07:30