What have you tried so far to solve the problem?
It seems like a pretty straightforward thing to do:
- Ask the user for their input
- Get the user's input
- Check if the user's input is a number: if not, display a message stating their input must be a number and go back to step 1
- Check if the number is greater than 18: if not return to step 1; otherwise display your message.
This can be accomplished with loops and if statements.
Have you ever tried using a
While Loop?
Are you having problems with understanding how to loop or how to stop looping?
Are you having problems understanding how to get input?
Are you having problems understating how to print output to the screen?
Are you having problems determining what the value was that the user entered?
What are you having problems with?