Question: Problem Description and Given Info Primary U . S . interstate highways are numbered 1 - 9 9 . Odd numbers ( like the 5

Problem Description and Given Info 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, the 405 services the 5, and the 290 services the 90. Write (define) a function named print_highway_info, that takes as its only argument a highway number (you can safely assume that the arguments will always be an integer). When this function is called, it should print out a string indicating if the highway is a primary or auxiliary, and if the highway goes east/west or north/south (see examples below). Examples: 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 north/south or east/west. print_highway_info(90) will print The 90 is primary, going east/west. print_highway_info(290) will print The 290 is auxiliary, serving the 90, going east/west. print_highway_info(185) will print The 185 is auxiliary, serving the 85, going north/south. You may wish to write some additional code to test your function. Please be sure that you delete (or comment out) any test code before you submit your solution. The only code in your solution when you submit should be the required function definition.

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!