elementary but urgent problem
I would like to take a 10-digit input, which is in a string called input, and take out the first 9 digits and put them into an int called isbn. Then, take out the last digit and put it into an int called vCheck. Now, this is an ISBN problem, so I also need something that checks if vCheck is an X. If vCheck is an X, then it has to be switched to 10, else 'not sure what to put here'.
Then, later on using the first 9 digits a calculation will take place. Out of this calculation the program will get a 10th digit and I want the program to check if this new digit (checkdigit) equals the initial 10th digit from before (vCheck). If they are equal then the program will output ("correct"), else it will output ("a correct ISBN would be: " + isbn + checkdigit).
I hope I'm not being confusing here, can anyone help me?