It appears you might want to add to the first question " or 'X' to exit"

Then preceed the question with

char firstChar = "";
while ((firstChar != 'X') && ((firstChar != 'x'))) {

Remove...