//JAVA PLEASE 1.20 LAB: Interstate highway numbers Primary U.S. interstate highways are numbered 1-99. Odd numbers (like

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

//JAVA PLEASE 1.20 LAB: Interstate highway numbers Primary U.S. interstate highways are numbered 1-99. Odd numbers (like

Post by answerhappygod »

//JAVA PLEASE
1.20 LAB: Interstate highway numbers Primary U.S. interstatehighways are numbered 1-99. Odd numbers (like the 5 or 95) gonorth/south, and evens (like the 10 or 90) go east/west. Auxiliaryhighways are numbered 100-999, and service the primary highwayindicated by the rightmost two digits. Thus, I-405 services I-5,and I-290 services I-90. Given a highway number, indicate whetherit is a primary or auxiliary highway. If auxiliary, indicate whatprimary highway it serves. Also indicate if the (primary) highwayruns north/south or east/west. Ex: If the input is: 90 the outputis: I-90 is primary, going east/west. Ex: If the input is: 290 theoutput is: I-290 is auxiliary, serving I-90, going east/west. Ex:If the input is: 0 or any number not between 1 and 999, the outputis: 0 is not a valid interstate highway number. Ex: If the inputis: 200 the output is: 200 is not a valid interstate highwaynumber. See Wikipedia for more info on highway numbering.
import java.util.Scanner;
public class LabProgram { public static void main(String[] args) { Scanner scnr = newScanner(System.in); int highwayNumber; int primaryNumber;
highwayNumber = scnr.nextInt(); }}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply