Java Code
Within the 1900 folder on your desktop, create a new folder named Lab3HWLastnameFirstname. Suppose you live in a city where the roads form a grid. Streets run north-south and are odd-numbered: Street 1, Street 3, Street 5, etc. from west to east. Avenues run west-east and are even-numbered: Avenue 2, Avenue 4, Avenue 6, etc. from north to south. The map below shows the first several streets and avenues. Note that the city is substantially larger than what's shown here; this partial map is just to give you a visual aid for how the roads are laid out. Streels Avenues The roads are all equally spaced, 1000 ft apart. The city is well developed, so you cannot cut across av blocks when traveling. For example, to get from the corner of Street 1 and Avenue 6 to the corner of Street 3 and Avenue 4, 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. Within your Labir folder, write a program named BestGPS yer tava that allows the user to enter the street and avenue of a starting and ending commer. The program should then print step-by-step navigation from the starting point to the ending point including the direction and distance traveled and any turns involved. Acain, note that the map provided here shows only the first several streets and avenues. Your program should support any positive odd input for streets and positive even Input for avenues Here are two examples of what your completed Dogram might look like when you run it. Underlined parts indicate what you type in as the program is running. Example 1 Starting corner: Street - 1 Avenue - 6 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 have arrived at your destination! Example 2 Starting corner: Street - 7 Avenue - 2 Ending corner: Street - Z Avenue - 8 Take Street 7 south for 3000.0 ft until you get to Avenue 8. You have arrived at your destination! This assignment likely seems very challenging at first glance, but don't panic! 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 vertical component. Start by considering the horizontal component. The distance traveled depends on the numbers of the starting and ending streets. The direction traveled (west or east) depends on whether the number of the starting street is larger than or smaller than the number of the ending street. Similarly for the vertical component, the distance traveled depends on the numbers of the starting and ending avenues. The direction traveled (north or south) depends on whether the number of starting avenue is larger than or smaller than the number of the ending avenue. If turn is involved, there are only two possible directions: left or right. What combinations of horizontal and vertical directions produce each kind of turn? There are a few situations in which no turn is needed: a horizontal-only trip, a vertical-only tri or a case where the starting and ending points are the same in that case, you're already at you destination). Your program should handle all of these