169k views
4 votes
In C++, 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 1-12, Chapter 1), the class dateType (as designed in Programming Exercise 2 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 operationsm 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.

User Nataraj
by
9.0k points

1 Answer

5 votes

Final answer:

The online address book in C++ requires the creation of classes addressType, extPersonType, and addressBookType, each handling different data and functionalities like storing and printing addresses, managing personal information, and processing up to 500 entries with various search and print capabilities.

Step-by-step explanation:

Designing an Online Address Book using C++

In C++, we can design an online address book by creating several classes that handle different aspects of the address book's functionality. The addressType class will encapsulate the details of a street address including street, city, state, and zip code, providing functions to store and print the address. Constructors will ensure that these data members are properly initialized. The extPersonType class will combine the capabilities of earlier defined classes (personType, dateType) with addressType, adding a data member to classify a person as a family member, friend, or business associate, and one to store phone numbers. Finally, the addressBookType class, derived from an array-based list class (arrayListType), is designed to handle up to 500 entries, providing functionality to:

  • Load data from a disk
  • Search for a person by last name
  • Print address, phone number, and date of birth
  • Print names for birthdays within certain conditions
  • Print names based on relationship status
  • Print names within a range of last names
User Anneliese
by
7.4k points