Question: Part 1 : Creating a Python program Scenario: This program expands the usability on Exercise 3 : If statements by allowing multiple inputs from the

Part 1: Creating a Python program
Scenario: This program expands the usability on Exercise 3: If statements by allowing multiple inputs from the user for one run of the program instead of ending after only one input. Each time the user types a y for the reprompt, the user will be prompted to enter in the first 6 hex values of the MAC address. If the user enters in n for the reprompt, the program will end. If the user enters in something other than one of these two values for the reprompt, the program will tell them it is invalid and reprompt them. The user should be able to keep entering in hex values until they type n for whether they want to repeat or should keep being reprompted for either a y or an n if they type something other than that for the repeat prompt.
Example 1: Ability to enter multiple hex values
The user enters 00:00:0C. When the program asks if the user wants to enter another one, the user typed y. The user then typed 00:00:17. When the program asked again, the user entered n and the program finished.
MAC Manufacturer Program
------------------------
Blank line
Enter the first 6 hex values of the MAC address (format as XX:XX:XX): 00:00:0C
For 00:00:0C the MAC manufacturer is Cisco Systems, Inc.
Blank line
Repeat (y=yes, n=no): y
Blank line
Enter the first 6 hex values of the MAC address (format as XX:XX:XX): 00:00:17
For 00:00:17 the MAC manufacturer is Oracle.
Blank line
Repeat (y=yes, n=no): n
Blank line
The program has ended.
Example 2: Invalid repeat prompt.
The user enters f. When the user is asked to repeat they typed d. The program told them it wasn't a valid option and reprompted them. The user typed in nothing (i.e. they just hit enter) and were reprompted. The user typed in y and then for the first 6 hex values the user typed in 00. When reprompted, they typed in n and the program finished.
MAC Manufacturer Program
------------------------
blank line
Enter the first 6 hex values of the MAC address (format as XX:XX:XX): f
For f the MAC manufacturer is Unknown.
blank line
Repeat (y=yes, n=no): d
blank line
Not a valid option. Repeat (y=yes, n=no):
Not a valid option. Repeat (y=yes, n=no): y
Enter the first 6 hex values of the MAC address (format as XX:XX:XX): 00
For 00 the MAC manufacturer is Unknown.
blank line
Repeat (y=yes, n=no): n
blank line
The program has ended.

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!