Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago