Nested If errors

Feb 23, 2016 at 11:45pm
(This is for a lab assignment) I have 9 errors, Syntax and missing ; between lines 64 and 129 (sorry!). I'm sorry if this is daunting but I'm really lost. Can I get help with figuring out why I'm receiving these errors?

int examgrade1 = 0, examgrade2 = 0, examgrade3 = 0, examgrade4 = 0;
int examcount = 4;

int A_Score = 90;
int B_Score = 80;
int C_Score = 70;
int D_Score = 60;

cout << setw(10) << left << "Exams" << setw(10) << "Exams" << setw(10) << "Letter" << endl;
cout << setw(10) << left << "1" << setw(10) << examgrade1 << setw(10) <<
if (examgrade1 >= A_Score)
{
cout << "A";
}
else
{
if (examgrade1 >= B_Score)
{
cout << "B";
}
else
{
if (examgrade1 >= C_Score)
{
cout << "C";
}
else
{
if (examgrade1 >= D_Score)
{
cout << "D";
}
else
{
cout << "F" << endl;
}
}
}

};

cout << setw(10) << left << "2" << setw(10) << examgrade2 << setw(10) <<
if (examgrade2 >= A_Score)
{
cout << "A";
}
else
{
if (examgrade2 >= B_Score)
{
cout << "B";
}
else
{
if (examgrade2 >= C_Score)
{
cout << "C";
}
else
{
if (examgrade2 >= D_Score)
{
cout << "D";
}
else
{
cout << "F" << endl;
}
}
}

};

cout << setw(10) << left << "3" << setw(10) << examgrade3 << setw(10) <<
if (examgrade3 >= A_Score)
{
cout << "A";
}
else
{
if (examgrade3 >= B_Score)
{
cout << "B";
}
else
{
if (examgrade3 >= C_Score)
{
cout << "C";
}
else
{
if (examgrade3 >= D_Score)
{
cout << "D";
}
else
{
cout << "F" << endl;
}
}
}
};

cout << setw(10) << left << "4" << setw(10) << examgrade4 << setw(10) <<
if (examgrade4 >= A_Score)
{
cout << "A";
}
else
{
if (examgrade4 >= B_Score)
{
cout << "B";
}
else
{
if (examgrade4 >= C_Score)
{
cout << "C";
}
else
{
if (examgrade4 >= D_Score)
{
cout << "D";
}
else
{
cout << "F" << endl
}
}
}

};
Feb 24, 2016 at 2:31am
Put your code between code tags, indent it and then post it again please.
Feb 24, 2016 at 4:34am
Pay attention to those error messages. If they're all saying the same thing, in that you're missing a semicolon somewhere..you might wanna double check your code. Especially when I scroll all the way down (mostly because I don't want to look at it) and I notice right away that

cout << "F" << endl exists.
Topic archived. No new replies allowed.