#include using namespace std; class student { public: string name; bool inState; int age; float gpa; char gender; }; int main () { void getInformation(student &); void printInformation(student); int n; cout << "How many students do you have: "; cin >> n; student s[n]; for (int i = 0; i < n; i++) { getInformation(s[i]); } for (int i = 0; i < n; i++) { printInformation(s[i]); } return 0; } void printInformation(student s) { cout << "Student Information: " << endl; cout << "\tName: " << s.name << endl; cout << "\tAge: " << s.age << endl; cout << "\tGPA: " << s.gpa << endl; cout << "\tGender: " << ((s.gender == 'M') ? "Male" : "Female") << endl; cout << "\tResident: " << ((s.inState) ? "Yes" : "No") << endl; } void getInformation(student &s) { char answer; cout << "What is your name: "; cin >> s.name; cout << "What is your age: "; cin >> s.age; cout << "What is your GPA: "; cin >> s.gpa; cout << "Are you male or female (M/F): "; cin >> s.gender; cout << "Do you live in the state of Ohio (y/n): "; cin >> answer; s.inState = (answer == 'y'); }