I tried the method a couple of you guys told me but it did not work.
This is what I tried: TryParse, While and If statements and the do-while statement too.
The problem is 1) to request TWO NUMBERS FROM THE USER, and then check those two numbers to see if they are numeric strings, and if they are some junks, 2) display a message that warns the user from entering the junk and he or she must enter numbers. 3) If the user keeps entering letters, characters or junk, the warning display message will keep popping up and keep telling the user to enter numbers until he or she does, then the message disappears.
NOTE: THIS IS NOT HE HOMEWORK...THE INSTRUCTOR DIDN'T REQUEST THIS. But as SixOfEleven stated, "When writing a program, the program must be robust and we don't want the program crash if anything happens.", and I think this is true. So in order to write robust codes, I must first do something to check and see what the user does is proper and accurate. So that comes the question above. The code or homework I did got shut, which is HERE.
I hope you guys could help me out because you guys have a lot of experience about this.
*** MOD EDIT: Took "credit" for closing the previous topics, so as to not besmirch SixOfEleven's good name ***
This post has been edited by JackOfAllTrades: 13 October 2009 - 01:42 PM

New Topic/Question
Reply




MultiQuote










|