The assigment sounds like this : Write a C++ program that request and displays information as show in the following example of out:
What is your first name? Betty Sue
What is your last name? Yew
What letter of grade do you deserve? B
What is your age? 22
Name: Yew, Betty Sue
Grade: C
Age: 22
Here is my code for it... I dont know how to decrease the Char by one since you input Grade B, it should output C. Here is my code so far, hope someone can help me out :)
#include <iostream>
using namespace std;
int main(){
char firstName[20];
char lastName[20];
char letterGrade[] = "ABCDF";
int whatAge;
cout << "What is your first name? ";
cin >> lastName;
cout << "What is your last name? ";
cin >> firstName;
cout << "What letter grade do you deserve? ";
cin >> letterGrade;
cout << "What is your age? ";
cin >> whatAge;
cout << "Name: "<< lastName<< ", "<< firstName<<endl;
cout << "Grade: "<< letterGrade<<endl;
cout <<"Age: " << whatAge;
cin.get();
cin.get();
return 0;
}