The application asks the user to enter the students major - either math or CIS and I wanted to make it so if the user were to enter something other than those two it would give an error message and prompt the user to enter the major again.
Here is what I have so far:
cout << "Math or CIS Major: ";
cin >> major;
if (major != "math" || major != "Math" || major != "CIS" || major != "cis") {
cout << "Invalid major" << endl;
}
cout << "Enter students GPA: ";
cin >> studentGpa;
This will give the invalid major message but it will just move onto the GPA
For some reason I can't remember the basics and this is tripping me up.
Also if someone could guide me in the right direction for an alternative to the ||'s I know this isn't the best way to do this but again I am struggling with coming up with a better way to do this again