Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a own 4- [ 40p]A barcode Scanner for Universal Product Codes (UPCs) verifies the 12-digit code scanned by comparing the code's last digit (called check

image text in transcribed

a own 4- [ 40p]A barcode Scanner for Universal Product Codes (UPCs) verifies the 12-digit code scanned by comparing the code's last digit (called check digit) computation of the check digit from the first 11 digits as follows: [step 1] Calculate the the digits in the odd-numbered positions (the first, third, eleventh digits) and multiply this sum by 3. sum II. (step 2] Calculate the Sum the digits in even-numbered positions second, fourth, tenth digits) and this to the previous result (result of stepl). III. (step 3]If the last digit of the result from step is 0, then 0 the check digit. Otherwise, subtract the last digit from 10 to calculate the check digit. IV. (step 4]If the check digit matches the final digit of the 12-digit UPC, the UPC is assumed correct. 1. 2. Write main function that prompts the user to enter the 12 digits of bar code. . The program should store the digits in an integer array. write check" function calculate the check digit, and compare it to the final barcode digit. If the digits match, output the barcode with the message Mvalidated. not, output barcode with the message "error in barcode. Also, output with labels the results from steps 1 and 2 of the check-digit calculations. Note that the first digit of the barcode will be stored in @lamento of the array. (clue : Mcheck" function ta kes two argument and it doesnt return any value)

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_2

Step: 3

blur-text-image_3

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions

Question

What is the principle of thermodynamics? Explain with examples

Answered: 1 week ago

Question

=+2 How does the preparation and support for each type of IE vary?

Answered: 1 week ago