Programming language is java.
Primary US interstate highways are numbered Odd numbers like the or go northsouth and evens like the or go eastwest Auxiliary highways are numbered and service the primary highway indicated by the rightmost two digits. Thus, I services I and I services I Note: is not a valid auxiliary highway because is not a valid primary highway number.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the primary highway runs northsouth or east
west.
this is the code I have so far.
src main java Main.java
public static void mainString args
Scanner scnr new ScannerSystem in;
int highwayNumber;
int primaryNumber;
boolean isEven;
highwayNumber scnrnextInt;
primaryNumber highwayNumber this will be the last two digits
isEven highwayNumber ; this will be true if the number is even
if highwayNumber highwayNumber
System.out.printlnhighwayNumber is not a valid interstate highway number.";
else if highwayNumber highwayNumber
if isEven true
System.out.printlnI highwayNumber is primary, going eastwest;
else
System.out.printlnI highwayNumber is primary, going northsouth;
else
if primaryNumber
System.out.printlnhighwayNumber is not a valid interstate highway number.";
else if primaryNumber
System.out.printlnI highwayNumber is auxiliary, serving I primaryNumber going eastwest;
else
System.out.printlnI highwayNumber is auxiliary, serving I primaryNumber going northsouth;