Q:

In a program what to say when the user enters the wrong type? e.g. number entered when yes/no expected

My program runs from the command line and requires the user to enter booleans (yes or no) and integers (numbers without decimals). For this I have two methods to check to make sure the user makes a valid entry, for example if the user is asked what temperature it is outside "cheese" isn't a valid response. What should happen if the user gives invalid input? Should the same prompt be repeated? Should it remind the user of the input type needed?
For example:
Please enter your height in cm: xyz
Please enter an integer.
Please enter your height in cm: 180
Do you wear glasses: 5
Please enter y/n.
Do you wear glasses: blah
Please enter y/n.
Do you wear glasses: y

Also, is it clear if a boolean is expected to tell the user to answer using y/n?

A:

Since it's a CLI, I don't think you need to explain too much. I'm assuming the end user is somewhat tech savvy, so they should be used to providing input the way you describe. My only recommendation is adding a hint at the end. i.e
Do you wear glasses (y/n):

