I'm quite new to c++ I'm experimenting a little with the CMD console, I'm really not experienced so the structure of my program is terrible, I'm freely open to more efficient ways, so feel free to tell me what I could do to improve it.
I'm trying to modify the program so that it will notify the user of their letter grade: 0-59=F 60-69=D 70-79=C 80-89=B 90-100=A
How would I go about doing this, if I input a score between 0-59 it'll print "you've achieved an F"
#include <iostream>
#include <windows.h>
#include <conio.h>
#include <string>
usingnamespace std;
void z() {Sleep(50);}
char x[] = "This is a simple program, which will enable to input your score and recieve the correct grade, depending on what score you input.\n ";
int main()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),10);
for(int i = 0; i < 135; i++)
{
cout << x[i];
z();
}
Sleep(2000);
cout << " To continue, press ENTER" << endl; cin.get();
system ("CLS");
Sleep(300);
string mystr;
int scoreA=100;
int scoreB=59;
int scoreC=69;
int scoreD=79;
int scoreE=89;
int score2;
cout << "hello, what is your NAME? " << endl;
getline(cin,mystr);
cout << "Loading grades......\n\n\n" << endl; Sleep(3000);
cout << "input your score, " << mystr << endl;
cin >> score2;
{
if (scoreA==score2)
cout << "You've achieved an A+" << endl;
}
{
if (scoreB==score2)
cout << "You've achieved an F-" << endl;
}
{
if (scoreE==score2)
cout << "You've achieved a B-" << endl;
}
{
if (scoreD==score2)
cout << "You've achieved a C-" << endl;
}
return 0;
}