Your logic is faulty. It should be 100-90 == A, 89-80 == B, 79-70 == C, 69-60 == D, 59-0 == F
You are doing 100-90 == A, 90-80 == B, 80-70 == C, 70-60 == D, 59-0 == F
Also, be a little more specific than "why doesn't it work" you're supposed to tell us what your errors are so we can help you to fix them not spot the errors for you.
However, now it always gives me the else statement. For example, if i put in a number, it will give me the correct Grade, but it will throw in a "no valid data" after it regardless. Is there a way to fix this?
Do i have to add brackets to each if statement, and then make more codes and all that?
#include <iostream>
using namespace std;
int main()
{
int x;
cout << "what percent did you get? \n";
cin >> x;
if (x <= 100 && x >= 90)
cout << "perfect A";
else if (x <= 89 && x >= 80)
cout << "B";
else if (x <= 79 && x >= 70)
cout << "C";
else if (x <= 69 && x >= 60)
cout << "D";
else if (x<59)
cout << "F";
else(x<0 && x>100);
cout << "no valid data entered";