That's because the try-catch is inside the while loop, so after the code in the catch block is done, it's just going through the loop again.
Another problem is that the condition of the while loop is count <= 10 but you are not incrementing count anywhere (you're only decrementing it in a couple of places) so it's going to take very long for count to become 10.
Ok I am sorry for the shitty explanation. First off I tried to put the catch outside of the loop but it doesn't work.
What I want is to ask "What age are you" ten times. I want only 4, 5 and 6 to be able to be entered and anything else to be refused. All other numbers entered will be handled by my else statement but whenever a character is entered the program receives an error and quits. So I used the Try/Catch. But for some reason when the catch is triggered it loops over and over again. I only want the try/catch to do the same thing my else does.
Ill worry about the second bit when I fix this first bit.
I hope you can understand now.
Thanks or the replys
Oh and I don't fully understand what Claudia was saying although maybe she is right? Sorry for the ignorance.
Joined: Nov 22, 2011
Edit: I solved most of this problem thanks for the help for now ranchers!!