switch(inputtext[0]){ case 'm': //he is male case 'f': //he is female default: //Send him again the dialog to type the correct answer}