#include <iostream>
#include <windows.h>
#include <cmath>
//Grade program!
usingnamespace std;
int grade;
string opt;
int main()
{
cout << "Hello, Please enter the grade you scored on a test from 1-100!\n";
cin >> grade;
{
while(true)
{
if (opt == "NO")
{
cout<< "Application will now close!";
Sleep(1000);
exit(1);
}
elseif (opt == "YES"){
system("CLS");
}
if (grade <= 59){
cout << "Your grade is a F!\n";
}
elseif (grade <= 69 && grade >= 60){
cout<< "Your grade is a D!\n";
}
elseif (grade >= 70 && grade <= 79){
cout<< "Your grade is a C!\n";
}
elseif (grade >= 80 && grade <= 89){
cout<< "Your grade is a B!\n";
}
elseif (grade >= 90 && grade is <= 100){
cout<< "Your grade is a A! Well done!\n";
}
cout<<"Would you like to enter another test score?\n";
cin>> opt;
}
}
return 0;
}
and heres the error i get:
|51|error: expected `)' before "is"|
I was just doing this to refresh my mind and im getting this error, Ive never even had it before?
If you did check line 51, then you would've noticed the extra "is" in your comparison. Remove that and you won't get that error anymore. Also, why did you put that extra "{" before while(true)?