ISBN Code is a 10 digit number where we can use 1 to 10 but 10 is represented by 'X'.
Ex. 2463781X95
Here X=10, but the 1st digit can not be 'X' or else it is invalid.
Now, to check any ISBN Code whether it is valid or not we have to multiply 1st digit with 1 and second digit with 2 up to tenth digit with 10 and have to add them together. The sum must be divisible by 11 or else it is invalid ISBN Code.
Ex. 2463781X95
sum = 2*1 + 4*2 + 6*3 + 3*4 + 7*5 + 8*6 + 1*7 + X*8 + 9*9 + 5*10.
and this 'sum%11=0', otherwise it is invalid.
Now, the question is one of the digits of the ISBN Code will be hidden by '?' and we have to find the correct digit for that place from 0-10 and that no will be the answer. As far as the property is concerned the founded no can not exceed X i.e. 10, if it does the corresponding error message should be, "No Possible Number Found". If the ISBN Code starts with X the error message should be "Invalid Code".
In case of bad inputs error message should be "Invalid Code".
Can anybody help me with the correct solution? Please post your program codes.