(Online Address Book Revisited) Programming Exercise in Chapter 3 could handle a maximum of only 500 entries. Using linked lists, redo the program to handle as many entries as required. Add the following operations to your program:
a. Add or delete a new entry to the address book.
b. When the program terminates, write the data in the address book to a disk.
Programming Exercise
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.
a. 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 data members.
b. Define a class extPersonType using the class personType (as defined in Example, Chapter 1), the class dateType (as designed in Programming Exercise of Chapter 2), and the class addressType. Add a data member to this class to classify the person as a family member, friend, or business associate. Also, add a data member to store the phone number. Add (or override) the functions to print and store the appropriate information. Use constructors to automatically initialize the data members.
c. Derive the class addressBookType from the class arrayListType, as defined in this chapter, so that an object of type addressBookType can store
objects of type extPersonType. An object of type addressBookType should be able to process a maximum of 500 entries. Add necessary operations to the class addressBookType so that the program should perform the following operations:
i. Load the data into the address book from a disk.
ii. Search for a person by last name.
iii. Print the address, phone number, and date of birth (if it exists) of a given person.
iv. Print the names of the people whose birthdays are in a given month or between two given dates.
v. Print the names of all the people having the same status, such as family, friend, or business.
vi. Print the names of all the people between two last names.
Example
The most common attributes of a person are the person’s first name and last name. The typical operations on a person’s name are to set the name and print the name. The following statements define a class with these properties.
//************************************************************// Author: D.S. Malik//// class personType// This class specifies the members to implementaname.//************************************************************#includeusing namespace std;class personType{public:void print () const;//Functiontooutput the first name and last name //in the form firstName lastName.void setName(string first, string last);//Functiontoset firstName and lastName according to the //parameters.//Postcondition: firstName = first; lastName = laststring getFirstName () const;//Functiontoreturn the first name.//Postcondition: The value of firstNameisreturned.string getLastName () const;//Functiontoreturn the last name.//Postcondition: The value of lastNameisreturned.personType ();//Default constructor//Sets firstName and lastName to null strings.//Postcondition: firstName = “ ”; lastName = “ ”;personType(string first, string last);//Constructor with parameters.//Sets firstName and lastName according to the parameters.//Postcondition: firstName = first; lastName = last;private:string firstName; //variable to store the first namestring lastName; //variable to store the last name};
Figure shows the UML class diagram of the class personType.
FIGURE 1–9
UML class diagram of the class personType

We now give the definitions of the member functions of the class personType.
void personType::print () const
{cout << firstName << “ ” << lastName; }void personType::setName (string first, string last){firstName = first;lastName = last;}string personType::getFirstName () const {return firstName;}string personType::getLastName () const{return lastName;}//Default constructor personType::personType (){firstName = “ ”;lastName = “ ”;}//Constructor with parameters personType::personType(string first, string last){firstName = first;lastName = last;}Programming Exercise
In this chapter, the class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not check whether the date is valid before storing the date in the data members. Rewrite the definitions of the function setDate and the constructor so that the values for the month, day, and year are checked before storing the date into the data members. Add a function member, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.