#include #include #include "PersonT.h" #include "StudentT.h" #include "GradStudentT.h" using namespace std; bool FindName(const vector & people, string key); //void PrintHighGPA(const vector & people); int main() { vector people; cout << "Just a person" << endl; people.push_back(new PersonT("Bob",5)); cout << endl; cout << "A student " << endl; people.push_back(new StudentT("Bill",15, 3.01f)); cout << endl; cout << "A student " << endl; people.push_back(new StudentT("Sue",21, 3.91f)); cout << endl; cout << "Just a person" << endl; people.push_back(new PersonT("Jane",40)); cout << endl; cout << " A grad student " << endl; people.push_back(new GradStudentT("Jeoff",25, 3.89f, {2015,2018})); cout << endl; for (auto x: people) { x->Print(); cout << endl; } cout << endl; FindName(people, "Bob"); FindName(people, "Jeoff"); FindName(people, "Stan"); GradStudentT person("Bill", 27, 3.84f, {2010, 2016, 2019}); cout << person.Name() << " has a gpa of " << person.GPA() << " and graduated in "; for(auto x: person.Years()) { cout << " " << x; } cout << endl; for(auto & x: people) { delete x; x = nullptr; } return 0; } bool FindName(const vector & people, string key){ for(auto x: people) { if (x->Name() == key) { cout << key << " is in the list." << endl; return true; } } cout << key << " is not in the list." << endl; return false; } /* void PrintHighGPA(const vector & people) { for(auto x: people) { if (x->GPA() > 3.0f) { x->Print(); } } return; } */