Question: DO NOT ALLOW TO IMPORT ANY INBUILT LIBRARY Universal Product Codes (UPCs) are used to identify the retail product. They usual have 12 decimal digits

DO NOT ALLOW TO IMPORT ANY INBUILT LIBRARY

DO NOT ALLOW TO IMPORT ANY INBUILT LIBRARY Universal Product Codes (UPCs)

Universal Product Codes (UPCs) are used to identify the retail product. They usual have 12 decimal digits where the last one is the check digit, which specifies if the fir 11 decimal digit is correct or not. You need to write a simple Python program that menu driven to check if the: a. Entered 12-digit UPC is valid UPC or not b. Find the last 12th digit (i.e. check digit) from the given first 11 digits of the UP The check digit is determined by: (3x1 + x2 + 3x3 + x4 + 3x5 + X6 + 3x2 + x3 + 3x + X10 + 3X11 + X12 ) mod 10 = 0 Sample Test Data and Sample Output: Please use the menu below to tell what you want to do: 1. Enter 12-digit UPC and check whether it is valid UPC or not 2. Find the check digit from the given 11-digit UPC Please enter your choice: 1 Please enter the 12-digit UPC: 041331021641 The entered UPC is not a valid UPC Do you want to exit (y or yes and n for no): n Please enter your choice: 2 Please enter the 11-digits UPC to find the check digit: 79357343104 The check digit for the given UPC is: 2 Do you want to exit (y or yes and n for no): Y All the text in red is the user input

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!