Question: Code in Java: please explain in details Program Requirements: Design a program that asks the user for a street number, type, and direction ( e

Code in Java: please explain in details
Program Requirements:
Design a program that asks the user for a street number, type, and direction (e.g., "North 4th Street").
Your program should then tell the user:
How many blocks east or west the street is from Central Avenue.
Whether the street is north or south of Washington Street.
The name of the preceding Avenue or Street (closer to Central Avenue) considering both direction and number.
Test the program to ensure it works correctly. The following examples can serve as a guide for the testing of the code.
Examples:
Input:
Direction: North
Street number: 12
Street type: Avenue
Output:
o North 12th Avenue is 12 blocks east of Central Avenue and is north of Washington Street.
o The preceding Avenue is North 11th Avenue.
Input:
o Direction: South
Street number: 4
Street type: Street
Output:
South 4th Street is 4 blocks west of Central Avenue and is south of Washington Street.
The preceding Street is South 3rd Street.
Input:
o Direction: North
Street number: 7
Street type: Lane
Output:
North 7th Lane is 7 blocks west of Central Avenue and is north of Washington Street.
The preceding Avenue is North 7th Avenue.
Input:
o Direction: South
Street number: 10
Street type: Way
Output:
o South 10th Way is 10 blocks east of Central Avenue and is south of Washington Street.
The preceding Street is South 10th Street.
Code in Java: please explain in details Program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!