I wrote a program that outputs the name equivalent of a numerical grade the user wrote into the console.
1 being FAIL
2 being SATISFACTORY
3 being GOOD
4 being VERY GOOD
5 being EXCELLENT
Now I would like to ask the user does he want to continue inputting the grades AFTER the first one runs,
e.g
input grade -> 5 Excellent Would you like to continue inputting grades? 1 - yes/ 0 -no
I'm clueless where to put the do while bool is true..
int main()
{
int grade;
do
{
cout << "input your grade: \n";
cin >> grade;
if (grade < 1 || grade > 5)
{
cout << "input grade again!\n";
}
} while (grade < 1 || grade > 5);
switch (grade)
{
case 1:
cout << "fail\n";
break;
case 2:
cout << "satisfactory\n";
break;
case 3:
cout << "good\n";
break;
case 4:
cout << "very good\n";
break;
case 5:
cout << "excellent\n";
break;
}
return 0;
}