Ok, I am newish at programming in c++ and am doing a computer science program in school. For my latest project I have come to a bit of a dead end and was hoping for some help with loops and ignoring characters.
The program is quite simple, it is a tax calculator. The program asks the user if they have any dependents. The user must answer with a y/Y/n/N(this part is fine, and is not where I am having issues) or it is acceptable for the user to enter a word. In the case that a user enters a word, I have to take the first character of the word and if it is a(n) y/Y/n/Y then the input is valid, and all other characters are ignored. If the first character is not a(n) Y/y/n/N then it is supposed to fail and then I have to use while loops.
My problem is I don't know how to ignore all characters after the first, and just validate the first character. I would really appreciate help on this. Oh, and I cannot use cin.ignore().
The program then goes on to promt the user for their income, then calculates it, this part I have no problem with.
Thanks for your help.