good_input = 0; while (not good_input) { display menu get user input if user input == 1 do stuff for choice one set good_input true elsif user input == 2 do stuff for choice two set good_input true # continue processing choices with elsif, # but the last bit should be the default # case: else display error message }