- #1
magnifik
- 360
- 0
Homework Statement
I need to make an error message that says "You must enter y or n" for a program. Right now I have this... this is only the part that i need help with, not the whole code.
cout << "Student? (y/n): ";
string student;
getline(cin, student);
i need to now make an if else statement like
if (_________){
cout << "You must enter y or n" << endl;
return 1;
}
i'm not sure what to put in the blank. i could do student.empty(), but the error message would only show up if a user didn't input anything. i need to put something in the if function that would cause the error message to show if the user didn't put anything, wrote a capital Y or capital N, wrote some other letter, etc.