My program is supposed to determine what a user's letter grade is from an input value, but it won't run because if this error:
48:2: error: expected unqualified-id before 'return'
--please help me fix it, I would greatly appreciate it. Thank you!
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
usingnamespace std;
int main()
{
char Answer;
int GradeValue;
cout << "Enter a Grade Value: \t";
cin >> GradeValue;
do {
if (GradeValue <60)
cout << "You earned an F for failure. Sad. Better luck next time."<<endl;
if (GradeValue >=60 && GradeValue< 63)
cout << "You earned a D-. Meh, at least you didn't fail!"<<endl;
elseif (GradeValue >=63 && GradeValue <67)
cout << "You earned a D. Better than a D-."<<endl;
elseif (GradeValue >=67 && GradeValue <70)
cout<< "You earned a D+. Hit the books!"<<endl;
elseif (GradeValue >=70 && GradeValue <73)
cout << "You earned a C-. You're getting there!"<<endl;
elseif (GradeValue >=73 && GradeValue <77)
cout << "You earned a C. Better than a C-!"<<endl;
elseif (GradeValue >=77 && GradeValue <80)
cout << "You earned a C+. Keep at it!"<<endl;
elseif (GradeValue >=80 && GradeValue <83)
cout << "You earned a B-. You're getting up there!"<<endl;
elseif (GradeValue >=83 && GradeValue < 87)
cout << "You earned a B. Good!"<<endl;
elseif (GradeValue >=87 && GradeValue <90)
cout << "You earned a B+. Keep it up!"<<endl;
elseif (GradeValue >=90 && GradeValue < 93)
cout << "You earned an A-. Nice job!"<<endl;
elseif (GradeValue >=93 && GradeValue < 97)
cout << "You earned an A. Awesome!"<<endl;
elseif (GradeValue >=97 && GradeValue <=100)
cout << "You got an A+. Can I be you?!?!"<<endl;
}
while (Answer=='y');
}
return 0;