Validation Program
Must be written in C++ as an “empty project”.
Program that will validate ISBNs. For each ISBN, the program should state if it is a valid or invalid ISBN, along with the appropriate error message, if invalid. The ISBN numbers are entered by user and your program should run as long as the user enters ISBN numbers to validate. Exit when user enters “q” or “Q”.
ISBN background:
An ISBN (International Standard Book Number) identifies a unique publication. An ISBN is ten digits. The first nine digits must be decimal digits (0…9). The tenth digit can be either a decimal digit or the letter X. Three single dashes may be between any of the characters. (i.e., an ISBN number may either have no dashes or exactly three dashes). Also, an ISBN must not begin or end with a dash, and sequential dashes are not allowed.
Some example ISBNs:
0-201-88337-6
0-13-117334-0
0821211315 (no dashes is ok)
1-57231-866-X
The last character of an ISBN number is a checksum. The checksum is determined from the first 9 digits; it is computed by taking modulo 11 (the remainder after dividing by 11) of the sum of each digit multiplied by its position in the ISBN. The letter X corresponds to a value of 10.
Here are two ISBNs and the calculations that show how the check sum is determined:
0-201-88337-6:(0*1 + 2*2 + 0*3 + 1*4 + 8*5 + 8*6 + 3*7 + 3*8 + 7*9)mod 11=6
1-57231-866-X:(1*1 + 5*2 + 7*3 + 2*4 + 3*5 + 1*6 + 8*7 + 6*8 + 6*9)mod 11=10(X)
For more info, check out: www.isbn.org.
Some invalid ISBNs:
0-201-8A337-6 (bad digit)
0-201-88337-63 (too many digits)
0-201-88-337-6 (too many dashes)
0-201883376 (not enough dashes)
0-201-88337-3 (wrong check sum)
-013-117334-0 (beginning or ending dash)
157231–866-X (sequential dashes)
013-1134-0 (too few digits)



