// File: Person.cpp // Member function definitions for class Person #include #include "Person.h" using namespace std; // Constructor copies the first and last names into the object. Person::Person(const string &first,const string &last,const string &social, int birthMonth,int birthDay,int birthYear) { setName(first,last); setSSN(social); dateOfBirth.setDate(birthMonth,birthDay,birthYear); } void Person::setName(const string &first,const string &last) { firstName = first; lastName = last; } void Person::setSSN(const string &social) { SSN=social; } // Output Person; should this be a friend? Can't it be avoided? ostream &operator<<(ostream &Dest,const Person &P) { Dest << P.firstName << ' ' << P.lastName << endl; Dest << "SSN:" << P.SSN << " DOB:" << P.dateOfBirth << endl; return(Dest); } void Person::print(ostream &Dest) const { Dest << *this;}