Question: Program 2 : interstate.py Primary U . S . interstate highways are numbered 1 - 9 9 . Odd numbers ( like the 5 or

Program 2:
interstate.py
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and
evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the
primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90.
Your program must also be able to detect invalid highway numbers. Note: 200 is not a valid auxiliary
highway because 00 is not a valid primary highway number.
Please enter an interstate number:200
200 is not a valid interstate highway number.
Given a highway number, indicate whether it is a primary, auxiliary highway or an invalid highway
number. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs
north/south or east/west.
Example Output
Please enter an interstate number:285
I-285 is auxiliary, serving I-85, going north/south.
Please enter an interstate number:85
I-85 is primary, going north/south.
Skills Covered
Creating if-elseif-else statements
Creating nested if-statements
Writing Conditional Expressions
Using Logical Operators
 Program 2: interstate.py Primary U.S. interstate highways are numbered 1-99. Odd

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 Databases Questions!