> Need help with Computer Science Assignment!!! Written in C++?

Need help with Computer Science Assignment!!! Written in C++?

Posted at: 2014-12-18 
UPC - The final digit of a 12-digit UPC is a check digit computed as follows:

1. Add the digits (up to but not including the check digit) in the odd-numbered positions (first, third, fifth, etc.) together and multiply by three.

2. Add the digits (up to but not including the check digit) in the even-numbered positions (second, fourth, sixth, etc.) to the result.

3. Take the remainder of the result divided by 10 (modulo operation).

4. If the remainder is 0, that is the check digit. Otherwise subtract the remainder from 10 to derive the check digit.

ISBN-10: The final character of a 10-digit ISBN is a check digit computed as follows:

1. Take the sum of the result of multiplying the first digit by 10, the second by 9, the third by 8, etc. (up to but not including the check digit).

2. Take the remainder of the result divided by 11 (modulo operation) and subtract this from 11 to derive the check digit. If the result is 10, the check digit is actually the letter 'X'.

ISBN-13: The final character of a 13-digit ISBN is a check digit generated the same way as the UPC except that the even digits are multiplied by 3 instead of the odd digits.

Write a program that

1. Permits the user to repeatedly enter numbers until a sentinel is entered,

2. Determines which of the above types the number is,

3. Verifies the check digit,

4. Outputs whether or not it is a valid UPC / ISBN-10 / ISBN-13 code.