Hey, I'm new to writing c++ programs and I have run into a problem. The program is supposed to take three inputs (name, gender, grade) and the program is supposed to start the student into one of 4 classes depending on gender and grade. But my problem is that I'm being told that M/F are not declared in this scope so I don't know what to do. The errors are in the If section of the program so I would like some insight as to how I can fix this. Thank you and its much appreciated for the help.
Here is the program:
# include <iostream>
using namespace std;
int main(){
int grade;
char gender;
string name;
cout << "What is your name?";
cin >> name;
cout << "What is your gender (M or F)?";
cin >> gender;
cout << "What is your grade?";
cin >> grade;
if (((gender=M)&&(grade>=90))||((gender=F)&&(grade>=80)))
cout << name << " is in Class A." << endl;
if (((gender=M)&&(grade>=70&&grade<=90))||((gender=F)&&(grade>=70&&grade<=80)))
cout << name << "is in Class B." << endl;
if ((gender=M)&&(grade<70)) cout << name << " is in Class C." << endl;
if ((gender=F)&&(grade<70)) cout << name << " is in class D." <<endl;
return 0;
}