CrazyLemurs
17-01-2013, 05:41 PM
Hey everyone
I'm doing 1/3 of 30% of my Computing CA and it's come up in it that I've got to program an ISBN book number calculator
I take in a 10digit number and have to make it to 11digits using some special formula etc etc.
But I take in the number as a string (so if they like type 123456789Q it doesnt crash the program) and have applied an if statement so IF userenter = 1 then DO CONVERSION TO 11DIGITS
But if they type in like ASBHFHKFLJHBS then I have an error as I cant subject a string to operators like = and +.
My teacher said to use CInt command to do this, but how does it work?
And is there any other way I can go about it if CInt isn't ideal?
Thanks in advance for your assistance xxxxxx
I'm doing 1/3 of 30% of my Computing CA and it's come up in it that I've got to program an ISBN book number calculator
I take in a 10digit number and have to make it to 11digits using some special formula etc etc.
But I take in the number as a string (so if they like type 123456789Q it doesnt crash the program) and have applied an if statement so IF userenter = 1 then DO CONVERSION TO 11DIGITS
But if they type in like ASBHFHKFLJHBS then I have an error as I cant subject a string to operators like = and +.
My teacher said to use CInt command to do this, but how does it work?
And is there any other way I can go about it if CInt isn't ideal?
Thanks in advance for your assistance xxxxxx