The problem is as follows:
A barcode scanner for Universal Product Codes (UPCs) verifies the 12-digit code scannedby comparing the code’s last digit (called a check digit) to its own computation of the checkdigit from the first 11 digits as follows:
1. Calculate the sum of the digits in the odd-numbered positions (the first, third, .. ,eleventh digits) and multiply this sum by 3.
2. Calculate the sum of the digits in the even-numbered positions (the second, fourth, .., tenth digits) and add this to the previous result.
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.
4. If the check digit matches the final digit of the 12-digit UPC, the UPC is assumedcorrect.
My issue is when the program is ran, it skips the first if statement ad just prints ERROR IN BARCODE;