#include #include using namespace std; class person { private: string name; int age; public: person() {} //default constructor person(int a, string n) // another constructor { age = a; name = n; } void getName() // an accessor { cout << "The person's name is: " << name << " " ; } int getAge() { return age; } void setInfo(int a, string n) // a modifier { age = a; name = n; } void makeOlder(int a) { age = age + a; } }; int main () { person a(21,"Barb"), b; b.setInfo(22, "Bob"); a.getName(); cout << a.getAge() << endl; b.getName(); cout << b.getAge() << endl; a.makeOlder(10); cout << endl; cout << "Age after makeOlder is " << a.getAge(); getchar(); return 0; }