Can any one please help me figure out what I am doing wrong on the following C++ programing language? I couldn't figure out what I am doing wronge that it gave me a hard time to compile it. Here is what I have done so far.
using namespace std;
struct grades
{
double total;
double quiz_value, score_quiz1, score_quiz2;
double midterm_value, score_midterm;
double final_value, score_final;
};
void final_grade(grades& the_grades);
int main()
{
grades data;
final_grade(data);
double quiz_value, midterm_value, final_value;
quiz_value = (data.score_quiz1 + data.score_quiz2)*(.25);
midterm_value =(data.score_midterm * .25);
final_value = (data.score_final * .50);
data.total = (quiz_value + midterm_value + final_value);
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout << "The accumlative score is: "
<< data.total << endl;
return 0;
}
void final_grade(grades& the_grades);
{
cout << "Enter the score of the first quiz: ";
cin >> the_grades.score_quiz;
cout << "Enter the score of the second quiz";
cin >> the_grades.score_quiz2;
cout << "Enter the score of the midterm";
cin >> the_grades.score_midterm;
cout << "Enter the score of the final";
cin >> the_grades.score_final;
}
char letterGrade (double numericGrade)
{
char letter;
if (numericGrade < 60)
letter = 'F';
else if (numericGrade < 70)
letter = 'D';
else if (numericGrade < 80)
letter = 'C';
else if (numericGrade < 90)
letter = 'B';
else
letter = 'A';
return letter;
}
// The error message I get is
// expected unqualified-id before '{'token
// expected `,' or `;' before '{' token