Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use beginner level java Suppose you live in a city where the roads form a grid. Streets run north-south and are odd-numbered: Street 1,

Please use beginner level java image text in transcribed
image text in transcribed
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. Streets The roads are all equally spaced, 1000 ft apart. The city is well developed, so you cannot cut across any 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 Lab3HV folder, write a program named BestGPSEver java that allows the user to enter the street and avenue of a starting and ending corner navigation from the starting point to the ending point, any turns involved. and ending corner. The program should then print step-by-sten inchading the direction and distance traveled and parts indicate what you type in as the program is running Example1 ere are two examples of what your completed program might look lke when you run it. Underlined Starting corner: Street -1 Avenue Ending corner: Street 3 Avenue 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! Example2 Starting corner Street- Avenue 2 Ending corner: Street I 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 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 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 mumber of the ending street ly for the vertical component, the distance traveled depends on the numbers of the starting number of . If a turn is involved, there are only two possible directions: left or right. What combinations of . There are a few situations in which no turn is needed: a horizontal-only trip, a vertical-only trip, and ending avenues. The direction traveled (north or south) depends on whether the starting avenue is larger than or smaller than the sumber of the ending avenue. horizontal and vertical directions produce each kind of turn? or a case where the starting and ending points are the same (in that case, you're already at your destination). 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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

What are the classifications of Bank?

Answered: 1 week ago