solution

Below are the steps and the book is used. Please follow the instructions in solving the problem

Java An Introduction to Problem Solving & Programming 2017 Walter Savitch (PDF)

Chapter 2,3,4 for reference.

Please Note

  • Consider the problem, design an algorithm that would solve the problem, and then implement the algorithm in Java.
  • Please insert the algorithm written in pseudocode as a comment at the beginning of your program.

Programming Problem 3 – Broken GPS

Consider yourself driving with 60 miles/hour in a city that has only grid like streets, and your GPS is broken.

The specifications of the problem are:

  • With (x, y) as the coordinates of the car, consider the initial position (0,0).
  • At each intersection, the only directions available are North, South, East or West
  • The GPS is broken, and it chooses the direction randomly at each intersection, which happens every 5 minutes
  • The assumption is that the car has the same speed at all times, including when it changes direction and turns.

Write a program that calculates the direct distance from the initial point to the location point of the driver after one hour of driving (i.e. the distance between two points).

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!