Error in Homework #Help


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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  #include <iostream>
using namespace 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;

	}
Last edited on
It really helps when you tell us what the errors are.
2 errors:

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
Line 19 and 24

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  #include <iostream>
using namespace 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;

	}
lols I was refreshing this page for a while then I just went over to stackoverflow. After I got the answer and came back you posted.
Topic archived. No new replies allowed.