// Project Copy // File person.cpp (class definition file) #include #include using namespace std; #include "person.h" // Default constructor. Person::Person() { name = "Unknown"; gender = 'U'; age = -1; } // Parameterized constructor. Person::Person(string n, char g, int a) { name = n; gender = g; age = a; } // Copy constructor. Person::Person(Person &other) { cout << "In copy constructor." << endl; name = other.name; gender = other.gender; age = other.age; } // Display method. void Person::display() { cout << name << " " << gender << " " << age << endl; } // Equals method passing by value. bool Person::equals(Person other) { return age == other.age; } // Use the header // bool Person::equals(const Person &other) // to avoid making a copy of Person object // to pass in to equals method.