Computers and Technology
Computers and Technology, 04.01.2022 21:50, shann7074

A barcode scanner for Universal Product Codes (UPCs) verifies the 12-digit code scanned by comparing

the code’s last digit (called a check digit ) to its own

computation of the check digit from the first 11 digits as follows:
I. [step 1]Calculate the sum of the digits in the
odd-numbered positions (the first, third, ...,
eleventh digits) and multiply this sum by 3.

II. [step 2]Calculate the sum of the digits in the
even-numbered positions (the second, fourth, ...,
tenth digits) and add this to the previous
result(result of step1).

III. [step 3]If the last digit of the result from step
2 is 0, then 0 is 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. Write main function that prompts the user to
enter the 12 digits of a barcode. The program
should store the digits in an integer array.

2. Write a “check” function to calculate the check
digit, and compare it to the final barcode digit.
If the digits match, output the barcode with the
message “validated.” If not, output the 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 element 0
of the array. (clue: “check” function takes two
argument and it doesnt return any value)

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:31, caseypearson377
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
image
Computers and Technology, 23.06.2019 12:10, jefersina16
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
image
Computers and Technology, 24.06.2019 18:30, hmae2304
*write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard).
Answers: 1
image
Computers and Technology, 25.06.2019 09:30, poop4992
Network administration is concerned with which tasks? the installation and maintenance of network hardware and software the installation and maintenance of computer operating systems the diagnosis and repair of some types of computer hardware the monitoring of users' activity on a social networking site
Answers: 1
Do you know the correct answer?
A barcode scanner for Universal Product Codes (UPCs) verifies the 12-digit code scanned by compari...

Questions in other subjects:

Konu
Mathematics, 22.02.2021 19:20
Konu
Mathematics, 22.02.2021 19:20