Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Thank You Within the 1900 folder on your desktop, create a new folder named Lab3HWLastnaneFirstname. Suppose you live in a city where the ronds form

image text in transcribed

image text in transcribed

Thank You

Within the 1900 folder on your desktop, create a new folder named Lab3HWLastnaneFirstname. Suppose you live in a city where the ronds form a grid. Streets run north-south and are odd-numbered Strvet 1, Stret 3, Strout 5, ete. from wst to enst. lvemes run wst-cast and ar evcnr-numbere Avenne 2, Avenne 4. Aveune 6, etc, from north to soutlh The roads are all equally spaced, 1000 ft apart. The eity is well developed, so you cannot cut across any blocks when traveling. For exauple, to get from the corner of Street 1 and Avenue 6 to the corner of Street 3 and Avenue 1, you would have to travel one block north on 1 and one block east on 4, or one block east on 6 and one block north on 1. Both routes have a total traveling distance of 2000 ft. Lab3u folder, write a progratn numel BestGPSEver.java that allows the user to enter Withim your the street and awaue of a starting and euding corner. The program abonld then print step-by-step navigation from the starting point to the caling point, including the direction and distee traveled and uny turns involwsl. Here are two examples of what yunr completed program might look lik when you run it. Underlined parts indieite whnt you type in us the program is running Example 1 Starting corner Street - Avenue 5 Ending corner: Street 3 Avenue 4 Take Avenue 6 east for 1000.0 ft until you get to Street 3. Turn left onto Street 3 Take Street 3 north for 1000.0 ft until you get to Avenue 4. You bave arrived at your destination Example 2 Starting corner: street Z Avenue Ending corner: Street z venue 8 Take Street 7 south for 3000.0 tt until you get to Avenue 8. You have arrived at your destination! This assignment likely scems very challenging at first glance, but don't panie! Pretend you're a sloth just chilling in the rain forest, and take it slowly step by step. Here are some hints to get you started The trip can be broken down into one horizontal component and one vettical componeut. . Start by considering the horizontal component. The distanee traveled depeuds on the numbers of the starting and eding strects. The dirertion traveled (west or east) depends on whether the number of the starting stret is larger than or smaller that the number of the eneling street. . Similarly for the vertical component, the distaacc traveled deprxls on the numbers of the starting . If a turn is involved, there are only two possible directions: left or right. What combinations of . Them are few situations in which no turn neded: a horizontal-only trip, a vertical-only trip, and ending avenues. The direction traveled (north or south) depends on whether the number of starting aveme is larger than or smaller than the nimber of the ending avenue. horizontal and vertical directions proclnce each kind of turn? or a case where the starting and ending points are the same (in thut euse, you're already at your destinstion). Your program should handle all of these

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

Recommended Textbook for

More Books

Students also viewed these Databases questions