That's more complicated then. You have to be ready for an uncooperative user who won't necessarily enter 'y' or 'n' and respond with a reprompt.

To get exclusively 'y' or 'n', follow the series of...