You are on page 1of 2

//preprocessor directives & headers.

#include <iostream> //utilized to instate basic I/O functionality.


#include <string> //implemented to utilize string datatype.
#include <iomanip> //Required to use various useful manipulators.
#include <fstream> //Required for input/output file processing.
#include "extPersonType.h" //references external header file.

//standard library
using namespace std; //allows the use of cout & endl without 'std::' prefix.

void extPersonType::setBirthDate(const dateType myDate){


birthDate.setDate(myDate.getMonth(), myDate.getDay(), myDate.getYear());
}

void extPersonType::getBirthDate(dateType& myDate) const{


myDate.setDate(birthDate.getMonth(),birthDate.getDay(), birthDate.getYear());
}

void extPersonType::setAddress(const addressType address){


myAddress.setStreet(address.getStreet());
myAddress.setCity(address.getCity());
myAddress.setState(address.getState());
myAddress.setZIP(address.getZIP());
}

void extPersonType::getAddress(addressType& address) const{


address.setStreet(myAddress.getStreet());
address.setCity(myAddress.getCity());
address.setState(myAddress.getState());
address.setZIP(myAddress.getZIP());
}

void extPersonType::print() const{


birthDate.printDate();
person.print();
myAddress.printAddress();
cout << "\n\t" << association << ", " << phone;
}

void extPersonType::setPerson(const string first, const string last){


person.setFirstName(first);
person.setLastName(last);
}

void extPersonType::getPerson(string& first, string& last) const{


first = person.getFirstName();
last = person.getLastName();
}

void extPersonType::setAssociation(const string myAssociation){


association = myAssociation;
}
void extPersonType::setPhone(const string myPhone){
phone = myPhone;
}

string extPersonType::getAssociation() const{


return association;
}

string extPersonType::getPhone() const{


return phone;
}

void extPersonType::setExtPerson(string first, string last, int month, int day, int year, string
myStreet, string myCity, string myState, int myZIP, string asso, string ph){
person.setFirstName(first);
person.setLastName(last);
birthDate.setDate(month, day, year);
myAddress.setStreet(myStreet);
myAddress.setCity(myCity);
myAddress.setState(myState);
myAddress.setZIP(myZIP);
setAssociation(asso);
setPhone(ph);
}

extPersonType::extPersonType(string first, string last, int month, int day, int year, string
myStreet, string myCity, string myState, int myZIP, string asso, string ph): person(first, last),
birthDate(month, day, year), myAddress(myStreet, myCity, myState, myZIP){
setAssociation(asso);
setPhone(ph);
}

You might also like