Question: Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends,

Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends, and certain business associates. Your program should be able to handle a maximum of 500 entries.

Define a class addressType that can store a street address, city, state, and ZIP code. Use the appropriate functions to print and store the address. Also, use constructors to automatically initialize the member variables.

Define a class extPersonType using the class personType (as defined in Example 10-10, Chapter 10), the class dateType(as designed in this chapters Programming Exercise 2), and the class addressType. Add a member variable to this class to classify the person as a family member, friend, or business associate. Also, add a member variable to store the phone number. Add (or override) the functions to print and store the appropriate information. Use constructors to automatically initialize the member variables.

Define the class addressBookType using the previously defined classes. An object of the type addressBookType should be able to process a maximum of 500 entries.

The program should perform the following operations:

Load the data into the address book from a disk (Ch11_Ex5Data.txt).

Sort the address book by last name.

Search for a person by last name (option 1).

Print the address, phone number, and date of birth (if it exists) of a given person (option 2).

Print the names of the people whose birthdays are in a given month (option 3).

Print the names of all the people between two last names (option 4).

Depending on the users request, print the names of all family members, friends, or business associates (option 5).

Print the entire address book (option 6).

Save the sorted address book to a file (option 7).

Terminate the program (option 9).

***PLEASE HELP ME I HAVE BEEN STRUGGLING WITH THIS ASSIGNMENT FOR THE PAST WEEK AND IT IS DUE TONIGHT. MY PROFESSOR SAID THAT THE ERRORS I AM GETTING NOW IS BECAUSE THERE ISN'T ANY CODE IN THE extPersonType.h and extPersonTypeImp.cpp files AND THAT I NEED TO COMPLETE THESE BEFORE DEBUGGING THE addressType FILES. I DON'T KNOW WHAT I AM DOING WRONG AND I REALLY NEED HELP. IT KEEPS SAYING 0% AND NONE OF THE TASKS ARE BEING PASSED IN CENGAGE MINDTAP. I PUT THE FILES BELOW. CHEGG WILL NOT ALLOW ME TO PUT ALL OF THE OTHER FILES FOR THE ASSIGNMENT ON HERE:**

*** addressType.h:

#ifndef H_addressType #define H_addressType

#include using namespace std;

class addressType { public: void print() const; void setAddress(string sAddress, string c, string s, string z); void getAddress(string& sAddress, string& c, string& s, string& z);

addressType(string sAddress = "", string c = "", string s = "", string z = "");

private: string streetAddress; string city; string state; string zip; };

#endif

*** addressTypeImp.cpp:

#include

#include

#include "addressType.h"

using namespace std;

void addressType::print() const {

cout << streetAddress << " ";

cout << city << ", " << state << " - " << zip << " ";

}

//end addressType::print()

void addressType::setAddress(string sAddress, string c, string s, string z) {

streetAddress = sAddress;

city = c;

state = s;

zip = z;

}

//end addressType::setAddress()

void addressType::getAddress(string& sAddress, string& c, string& s, string& z) {

sAddress = streetAddress;

c = city;

s = state;

z = zip;

}

//end addressType::getAddress()

addressType::addressType(string sAddress, string c, string s, string z) {

streetAddress = sAddress;

city = c;

state = s;

zip = z;

}

//end constructor

*** extPersonType.h:

//extPersonType. #ifndef H_extPersonType #define H_extPersonType

#include #include "addressType.h" #include "dateType.h" #include "personType.h"

class extPersonType: public personType { public: void printAddress() const; void printInfo() const; void setInfo(string fName, string lName, int month, int day, int year, string street, string c, string s, string z, string phone, string pStatus); void setInfo(string fName, string lName, dateType d, addressType ad, string phone, string pStatus); bool isLastName(string lName) const;

void getAddress(string& sAddress, string& c, string& s, string& z);

string getStatus() const; string getPhoneNumber() const;

bool isStatus(string status);

bool isDOB(int month, int day, int year); void getDOB(int& month, int& day, int& year);

bool isMonth(int month) const;

extPersonType(string fName = "", string lName = "", int month = 1, int day = 1, int year = 1900, string street = "", string c = "", string s = "", string z = "", string phone = "", string pStatus = "");

private: addressType address; dateType dob; string phoneNumber; string personStatus; };

#endif

*** extPersonTypeImp.cpp:

#include

#include

#include "extPersonType.h"

void extPersonType::printAddress() const {

personType::print();

cout << " ";

address.print();

}

//end extPersonType::printAddress()

void extPersonType::printInfo() const {

personType::print();

cout << " ";

cout << "Date of Birth: ";

DOB.printDate();

cout << " ";

cout << "Phone Number: " << phoneNumber << " ";

cout << "Person Type: " << personStatus << " ";

address.print();

cout << " ";

}

//end extPersonType::printInfo()

void extPersonType::setInfo(string fName, string lName, int month, int day, int year, string street, string c, string s, string z, string phone,

string pStatus) {

personType::setName(fName, lName);

DOB.setDate(month, day, year);

address.setAddress(street, c, s, z);

phoneNumber = phone;

personStatus = pStatus;

}

//end extPersonType::setInfo()

void extPersonType::setInfo(string fName, string lName, dateType d, addressType ad, string phone, string pStatus) {

personType::setName(fName, lName);

DOB = d;

address = ad;

phoneNumber = phone;

personStatus = pStatus;

}

//end extPersonType::setInfo()

bool extPersonType::isLastName(string lName) const {

return(getLastName() == lName);

}

//end extPersonType::isLastName()

void extPersonType::getAddress(string& sAddress, string& c, string& s, string& z) {

address.getAddress(sAddress, c, s, z);

}

//end extPersonType::getAddress()

string extPersonType::getPhoneNumber() const {

return phoneNumber;

}

//end extPersonType::getPhoneNumber()

string extPersonType::getStatus() const {

return personStatus;

}

//end extPersonType::getStatus()

bool extPersonType::isStatus(string status) {

return (status == personStatus);

}

//end extPersonType::isStatus()

bool extPersonType::isDOB(int month, int day, int year) {

return(DOB.getMonth() == month && DOB.getDay() == day && DOB.getYear() == year);

}

//end extPersonType::isDOB()

void extPersonType::getDOB(int& month, int& day, int& year) {

month = DOB.getMonth();

day = DOB.getDay();

year = DOB.getYear();

}

//end extPersonType::getDOB()

bool extPersonType::isMonth(int month) const {

return(DOB.getMonth() == month);

}

//end extPersonType::isMonth

extPersonType::extPersonType(string fName, string lName, int month, int day, int year, string street, string c, string s, string z, string phone,

string pStatus) {

personType::setName(fName, lName);

DOB.setDate(month, day, year);

address.setAddress(street, c, s, z);

phoneNumber = phone;

personStatus = pStatus;

}

//end constructor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!