Validating user input using try-catch with reprompt

Hi all,

To handle invalid user input, I usually just loop to reprompt until the input is valid.

But my assignment details states that I need to catch multiple exceptions using try and catch.

I'd still like to reprompt the user but how do I use them in a loop without using continue.

Encasing try-catch in a loop, and setting a boolean in the catch blocks makes the exception handling superfluous.

Is there a better way to implement this?

Many thanks in advance :)
...yes, don't use try...catch at all when forcing the user to input properly...

It seems you have a very good handle on what is necessary to handle the possibilities. You should go ask your professor what it is he would like to see.

Sorry, and good luck!
Aw shucks.. I'll try to catch my prof then

Thanks for the reply! :)
Topic archived. No new replies allowed.