Okay I know this is more text than you want but I literally cannot find the problem in the following code
#include <iostream>
using namespace std ;
int main(void)
{
int score1, score2;
PrintInfo() ;
score1 = GetScore(); // Call function GetScore, to obtain a value for score1.
if (RangeError()) ; // IF score1 is out of range, print an error message.
{
cout << "Sorry you entered an invalid score." << endl ;
}
else // THIS IS LINE 46, THIS IS THE ELSE IT IS TALKING ABOUT
{
score2 = Getscore ; // Call GetScore a second time, to obtain a value for score2.
if (RangeError ()); // IF score2 is out of range, print an error message.
{
cout << "Sorry you entered an invalid score." << endl ;
}
else // ELSE, using a call to function maximum within a cout
{ // statement, print the maximum score.
cout << maximum() << endl ;
}
}
return 0;
}
There’s a lot in there, I know, but the main problem seems to be around my second else. For whatever reason I keep getting the following errors:
lab05a.cpp:46: error: expected `}’ before ‘else’
lab05a.cpp: At global scope:
lab05a.cpp:46: error: expected unqualified-id before ‘else’
I know it’s something to do with bracketing but I can’t find any problems! Also: I apologize for the lack of line numbers, we are not using an editor that allows them. I could have added them, but I removed a lot of irrelevant text for brevity and adding them on would not have given them the proper line number for the error. As such I will show where line 46 is. I removed most of the declarations since the problem does not seem to lie therein. Please help me, this is the first time I’ve ever had a problem I couldn’t solve on my own.
should be