Help

I am new to programming and need help figuring out the error in my program. I cant find the error. I've tried stepping away for a while then coming back but still cant find it.

error code- fatal error C1075: end of file found before the left brace '{' at 'g:\lab5_ortega\lab5_ortega\lab5_jose_ortega.cpp(49)' was matched

Help.
Thank you.
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

#include <cmath>
#include <iostream>

int mian()

{
	using namespace std;
//variables needed
	//int a;
	//int b;
	//int c;
	//int d;
	//int f;
	int grade;
	

	//here user will input numberical grade 0-100 to get a,b,c,d, or f
	cout << "Please enter your numberical grade between 0-100: " << endl;
	cin >> grade;
	//here is where i declare the value of the variables
	if (grade < 60)         // if they enter less than 60 they have an f 
	
{
		cout <<  "Your grade is an F " << "You failed! " << endl << endl;
	}
	else
	{
		if (grade < 70)
	{
		cout << "Your Grade is a D " << "You got some credit! "<< endl << endl;
	}
	else
	{ 
	if (grade < 80)
	{
		cout << "Your grade is a C " << "You just made it! "<< endl << endl;
	}
	else
	{
	if (grade < 90)
	{ 
		cout << "Your grade is a B " << "You Passed! " << endl << endl;
	}
	else
	{
	if (grade < 100)
	{
		cout << "Your grade is an A " << "Great Job! You Passed! " << endl << endl;
	}




	
	return 0;
	}
Last edited on
You have 10 '{' in your code. You must also have 10 '}' in your code to close those scopes. You have half that number.

1
2
3
4
5
6
7
8
9
10
11
12
13
    if ( grade < 60 )
    {
        // ...
    }
    else if ( grade < 70 )
    {
        // ...
    }
    else if ( grade < 80 )
    {
        // ...
    }
    // ...  


First of all it's spelled "main" not "mian" (Unless you are of pre-columnbian origin.)

You need to match your curly braces. I would suggest that you put a comment after each right-curly brace to document with which left-curly brace it belongs.
Topic archived. No new replies allowed.