I don't know if this is possible to do, the way I'm trying it, but I'll explain the best I can..
#include <iostream>
using namespace std;
int main()
{
const char Size = 20;
char FirstName[Size];
enum grades {A, B, C, D, E};
grades TEST;
cout << "What is your first name? ";
cin.getline(FirstName, Size);
cout << "What is your last name? ";
char LastName;
cin >> LastName;
cout << "What letter grade do you deserve? ";
int TEST;
cin >> TEST;
Actual_Grade = TEST + 1;
cout << "What is your age? ";
int age;
cin >> age;
cout << "Name:" << LastName << "," << FirstName << "\n";
cout << "Grade:" << Actual_Grade << "\n";
cout << "Age:" << age << "\n";
return 0;
}
I would like the output to be like this:
What is your first name? John Doe
What is your last name? Hanncock
What letter grade do you deserve? A
What is your age? 20
Name: Hanncock, John Doe
Grade: B
Age: 20
Notice in the output, how the "A" grade is incremented to "B"... Basically, the user does not end up getting the grade he wants... A practice assignment in my book asks to write a program that resembles the output above...
I just can't figure out how to make the "A" increment to one lower, which happens to be "B", in this case.. As I said, I don't know if this is possible to do the way I'm trying, but this is the code I've got so far..
I can't get it to compile, as is...