Asked by Anonymous
Say I write an application that prompts the user to enter an integer. If the user enters a double or string or anything, anything not an integer an error will appear. I'm having trouble writing code to combat this problem so I can errorproof my application.
I'm thinking I'll need to use a while loop to continually ask the user for an integer if they keep inputting something that's not an integer.
I'm thinking I'll need to use a while loop to continually ask the user for an integer if they keep inputting something that's not an integer.
Answers
Answered by
Steve
that'd be a good way
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.