Last active
June 16, 2020 09:48
-
-
Save 2hanX/77c628bf554f1c578c31119df61c50d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
using namespace std; | |
struct student | |
{ | |
string fname, lname; | |
char grade; | |
int age; | |
}; | |
void display(student su) | |
{ | |
cout << "Name: " << su.lname; | |
cout << ", " << su.fname << "\n"; | |
cout << "Grade: " << char(su.grade+1) << "\n"; | |
cout << "Age: " << su.age << endl; | |
} | |
int main() | |
{ | |
student su; | |
cout << "What is your first name? "; | |
getline(cin,su.fname); | |
cout << "What is your last name? "; | |
getline(cin,su.lname); | |
cout << "What letter grade do you deserve? "; | |
cin >> su.grade; | |
cout << "What is your age? "; | |
cin >> su.age; | |
display(su); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment