1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
void personType::printInfo() const
{
cout << firstName << " " << lastName;
}
void personType::setInfo(string first, string last)
{
firstName = first;
lastName = last;
}
//constructor
personType::personType(string first, string last)
{
firstName = first;
lastName = last;
}
///////////////////////////////////////////
// implementation of class addressType
///////////////////////////////////////////
void addressType::printInfo() const
{
cout << state << ", " << zip << endl;
}
void addressType::setInfo(string s, string z)
{
state = s;
zip = z;
}
addressType::addressType(string s, string z)
{
state = s;
zip = z;
}
///////////////////////////////////////////////////////////////////
// implementation of member functions of class extPersonType
///////////////////////////////////////////////////////////////////
void extPersonType::printInfo() const{
personType::printInfo();
address.printInfo();
cout << phoneNumber << ", " << personStatus << endl;
}
void extPersonType::setInfo(string fName, string lName,
string s, string z,
string phone, string pStatus)
{
personType::setInfo(fName, lName);
address.setInfo(s, z);
phoneNumber = phone;
personStatus = pStatus;
}
string extPersonType::getStatus() const{
return personStatus;
}
extPersonType::extPersonType(string fName, string lName,
string s, string z,
string phone, string pStatus)
:personType(fName, lName),
address(s, z)
{
phoneNumber = phone;
personStatus = pStatus;
}
///////////////////////////////////////////////////////////////////
// implementation of member functions of class addresbooktype
///////////////////////////////////////////////////////////////////
void addressBookType::printInfo() const
{
for (int i = 0; i < length; i++){
list[i].printInfo();
}
}
void addressBookType::printInfoWithStatus(string status)
{
for (int i = 0; i < length; i++)
if (list[i].getStatus() = status)
{
list[i].printInfo();
cout << endl;
}
}
addressBookType::addressBookType(){
length = 0;
}
|