Example Input: 90 Output: I-90 is primary, going east/west. Input: 290 Output: I-290 is auxiliary, serving I-90, going east/west. Input: 0 Output: WARNING: 0 is not a valid interstate highway number. Input: 200 Output: WARNING: 200 is not a valid interstate highway number. See Wikipedia for more info on highway numbering. 414136.2652726.qx3zqy7 LAB ACTIVITY 1 def...(): 2 3 3.20.1: LAB: Interstate Highway Numbers 4 5 if name == "__main__": 6 7 8 9 highway_number = int(input()) # TODO: finish the main program main.py 0/14 Load default template...
Example Input: 90 Output: I-90 is primary, going east/west. Input: 290 Output: I-290 is auxiliary, serving I-90, going east/west. Input: 0 Output: WARNING: 0 is not a valid interstate highway number. Input: 200 Output: WARNING: 200 is not a valid interstate highway number. See Wikipedia for more info on highway numbering. 414136.2652726.qx3zqy7 LAB ACTIVITY 1 def...(): 2 3 3.20.1: LAB: Interstate Highway Numbers 4 5 if name == "__main__": 6 7 8 9 highway_number = int(input()) # TODO: finish the main program main.py 0/14 Load default template...
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
![Example
Input:
90
Output:
I-90 is primary, going east/west.
Input:
290
Output:
I-290 is auxiliary, serving I-90, going east/west.
Input:
0
Output:
WARNING: 0 is not a valid interstate highway number.
Input:
200
Output:
WARNING: 200 is not a valid interstate highway number.
See Wikipedia for more info on highway numbering.
414136.2652726.qx3zqy7
LAB
ACTIVITY
3.20.1: LAB: Interstate Highway Numbers
1 def ...():
2
3
4
5 if _name__ == "__main__":
6
7
8
9
highway_number = int(input())
# TODO: finish the main program
main.py
0/14
Load default template...](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F280dcd23-77f5-41db-b4b4-aa0365f7e9e1%2F51019150-b703-49ac-92fc-488af68781c4%2F53gi1m_processed.png&w=3840&q=75)
Transcribed Image Text:Example
Input:
90
Output:
I-90 is primary, going east/west.
Input:
290
Output:
I-290 is auxiliary, serving I-90, going east/west.
Input:
0
Output:
WARNING: 0 is not a valid interstate highway number.
Input:
200
Output:
WARNING: 200 is not a valid interstate highway number.
See Wikipedia for more info on highway numbering.
414136.2652726.qx3zqy7
LAB
ACTIVITY
3.20.1: LAB: Interstate Highway Numbers
1 def ...():
2
3
4
5 if _name__ == "__main__":
6
7
8
9
highway_number = int(input())
# TODO: finish the main program
main.py
0/14
Load default template...
![Primary U.S. interstate highways are numbered 1-99.
• Odd numbers (like the 5 or 95) go north/south, and even numbers (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, 1-405 services
1-5, and 1-290 services 1-90.
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.
Use the information above to write several functions to help you determine this information. Call these functions in your main program to
produce the requested output.
Instructions
The functions
Write a function get_direction () that expects a highway number.
• Returns a string "north/south" if the highway number is odd (like the 5 or 95);
• Returns "east/west" if the highway number is even (like the 10 or 90).
If the function is called with the following input
290
the return value is
east/west
Write a function get_primary_hwy () that expects an auxiliary highway number. The function returns the primary highway it serves; the
return value is a string. The function returns None if the highway number is less than 100.
If the function is called with the following input
290
the return value is
I-90
The main program
Ask the user to input a highway number.
Check if it is a valid highway number. If it is not valid, print the warning as shown below. If it is valid, proceed with the rest of the program.
Get the highway direction by calling the get_direction () function.
Check if the highway is primary (use the if/else). If it is primary, print the primary highway information as shown in the example below.
If the highway is not primary, call the get_primary_hwy(). Print the auxiliary highway information as shown in the example below.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F280dcd23-77f5-41db-b4b4-aa0365f7e9e1%2F51019150-b703-49ac-92fc-488af68781c4%2F37grorb_processed.png&w=3840&q=75)
Transcribed Image Text:Primary U.S. interstate highways are numbered 1-99.
• Odd numbers (like the 5 or 95) go north/south, and even numbers (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, 1-405 services
1-5, and 1-290 services 1-90.
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.
Use the information above to write several functions to help you determine this information. Call these functions in your main program to
produce the requested output.
Instructions
The functions
Write a function get_direction () that expects a highway number.
• Returns a string "north/south" if the highway number is odd (like the 5 or 95);
• Returns "east/west" if the highway number is even (like the 10 or 90).
If the function is called with the following input
290
the return value is
east/west
Write a function get_primary_hwy () that expects an auxiliary highway number. The function returns the primary highway it serves; the
return value is a string. The function returns None if the highway number is less than 100.
If the function is called with the following input
290
the return value is
I-90
The main program
Ask the user to input a highway number.
Check if it is a valid highway number. If it is not valid, print the warning as shown below. If it is valid, proceed with the rest of the program.
Get the highway direction by calling the get_direction () function.
Check if the highway is primary (use the if/else). If it is primary, print the primary highway information as shown in the example below.
If the highway is not primary, call the get_primary_hwy(). Print the auxiliary highway information as shown in the example below.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY