// Project AllPersons // File main.cpp #include #include using namespace std; #include "allpersons.h" int main() { AllPersons x(10); // The Person object y is reused to // add all the persons to x. Person y; y.setPerson("Tom", 'M', 23); x.add(y); y.setPerson("Sally", 'F', 31); x.add(y); y.setPerson("Jane", 'F', 19); x.add(y); cout << "Tom " << x.getGender("Tom") << " " << x.getAge("Tom") << endl; cout << "Sally " << x.getGender("Sally") << " " << x.getAge("Sally") << endl; cout << "Jane " << x.getGender("Jane") << " " << x.getAge("Jane") << endl; return EXIT_SUCCESS; }