Computers and Technology

Imagine yourself in the middle of Manhattan, where the streets are perpendicular on avenues. You are in a grid of streets, somewhat lost, and you randomly pick one of four directions and walk to the next intersection. Not knowing where you really want to go, you again randomly pick one of the four directions, and so on. After repeating the same movement for a number of times, you may want to know how far you got from the original point. Represent locations as integer pairs(x, y). Create an algorithm that implements your movement through New York City, over 100 intersections, starting at (0,0) and print the ending location, taking into consideration that each movement, from one intersection to another will be one mile.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 17:10, dashia84
Write an application that allows a user to enter the names and birthdates of up to 10 friends. continue to prompt the user for names and birthdates until the user enters the sentinel value “zzz” for a name or has entered 10 names, whichever comes first. when the user is finished entering names, produce a count of how many names were entered, and then display the names. in a loop, continuously ask the user to type one of the names and display the corresponding birthdate or an error message if the name has not been previously entered. the loop continues until the user enters “zzz” for a name. save the application as birthdayreminder. java.
Answers: 1
image
Computers and Technology, 21.06.2019 23:30, jcollings44
You picked the corridor which led you here. if the guards find you, they're going to be really angry! what is the synonym of angry
Answers: 1
image
Computers and Technology, 22.06.2019 04:00, yolo1430
Acetylene is a gas which burns rapidly on its own, and is considered highly explosive. a) true b) false
Answers: 2
image
Computers and Technology, 22.06.2019 06:00, kiaunarayne808
The width of a piece of rectangular land is 5m shorter rhan 1/3 of its length .find the width of the land if the length is 60m,150m.
Answers: 1
Do you know the correct answer?
Imagine yourself in the middle of Manhattan, where the streets are perpendicular on avenues. You are...

Questions in other subjects:

Konu
Mathematics, 21.04.2021 22:00
Konu
Mathematics, 21.04.2021 22:00
Konu
Mathematics, 21.04.2021 22:00