1UPC Symbols
Universal Product Code (UPC) symbols are found on most products in grocery and retail stores. The UPC symbol is a 12-digit code identifying the manufacturer of a product and the product itself (FigureΒ 3.32). The first 11 digits contain information about the product; the twelfth digit is used for error detection. If is a valid UPC number, then
Show that the UPC number 0-50000-30042-6, which appears in FigureΒ 3.32, is a valid UPC number.
Show that the number 0-50000-30043-6 is not a valid UPC number.
Write a formula to calculate the check digit, in the UPC number.
The UPC error detection scheme can detect most transposition errors; that is, it can determine if two digits have been interchanged. Show that the transposition error 0-05000-30042-6 is not detected. Find a transposition error that is detected. Can you find a general rule for the types of transposition errors that can be detected?
Write a program that will determine whether or not a UPC number is valid.
