Question: Primary U . S . interstate highways are numbered 1 - 9 9 . Odd numbers ( like the 5 or 9 5 ) go
Primary US interstate highways are numbered Odd numbers like the or go northsouth and evens ike the or go
eastwest Auxiliany highways are numbered and service the pr mary highway indicated by the rightmost two digits. Thus,
services and services Note: is not a vald auxillary highway because not a valid primary highway number.
Given a highway number, indicate whether it a primary or auxillary highway. If auxilary, indicate what primary highway it serves. Also
indicate if the primary highway runs northsouth or eastwest
Ex: If the input is:
the output is:
I is primary, going eastwest
Ex: If the input is:
the output is:
I is auxiliary, serving I going eastwest
Ex: If the input is:
or any number not between and the output is:
not a valid interstate highwey number.
Ex: If the input is:
the output is:
not a valid interstate highway number.
See Wikipedia for more info on highway numbering.
Laport Java.utll.Scanner;
public class Latbrogram
public static vold mainString args
Scanner sonr new ScannerSysten in;
Int highwayNumber;
t primaryNunber;
highwayNumber scn nextInt;
Type your sode here.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
