I was testing it to the if(grade>=80)
if(grade<90) and it worked so I just rushed the rest
since it's basically this with the numbers changed but now I get errors for some reason. Maybe I mistyped or missing something. I'm trying to find the mistake.
#include <iostream>
usingnamespace std;
int main()
{ int grade;
cout << "What is your grade? ";
cin >> grade;
if(grade>=90){
cout << "You have an A in the class" << endl;
}
if(grade>=80){
if(grade<90){
cout << "You have a B in the class" << endl;
}
if(grade>= 70){
if(grade<80){
cout << "You have a C in the class" << endl;
}
if(grade<70){
cout << "You have a F in the class and you failed" << endl;
}
return 0;
}
1) error C1075: end of file found before the left brace '{' at 'C:x - gary.cpp' was matched
Line 32 Column 1
2) IntelliSense expected a '}'
Line 31 Column 2
#include <iostream>
usingnamespace std;
int main()
{ int grade;
cout << "What is your grade? ";
cin >> grade;
if(grade>=90){
cout << "You have an A in the class" << endl;
}
if(grade>=80){
if(grade<90){
cout << "You have a B in the class" << endl;
}
}//<<<<<<<<<<<<<<<<<<<<
if(grade>= 70){
if(grade<80){
cout << "You have a C in the class" << endl;
}
}//<<<<<<<<<<<<<<<<<<<<
if(grade<70){
cout << "You have a F in the class and you failed" << endl;
}
return 0;
}