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 chapter’s 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 user’s 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). An example of the program is shown below: Enter file name: Ch11_Ex5Data.txt Welcome to the address book program. Choose among the following options: 1: To see if a person is in the address book 2: Print the information of a person 3: Print the names of person having birthday in a particular month 4: Print the names of persons between two last names 5: Print the names of persons having a particular status 6: Print the address book 7: Save data 9: Terminate the program 2 Enter the last name of the person: Balto Brave Balto Date of Birth: 2-6-1975 Phone Number: 415-782-5555 Person Type: Business Disney Road Orlando, Florida - 35672

icon
Related questions
Question

Instructions

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.

  1. 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.

  2. Define a class extPersonType using the class personType (as defined in Example 10-10, Chapter 10), the class dateType(as designed in this chapter’s 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.

  3. 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 user’s 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).

An example of the program is shown below:

Enter file name: Ch11_Ex5Data.txt Welcome to the address book program. Choose among the following options: 1: To see if a person is in the address book 2: Print the information of a person 3: Print the names of person having birthday in a particular month 4: Print the names of persons between two last names 5: Print the names of persons having a particular status 6: Print the address book 7: Save data 9: Terminate the program 2 Enter the last name of the person: Balto Brave Balto Date of Birth: 2-6-1975 Phone Number: 415-782-5555 Person Type: Business Disney Road Orlando, Florida - 35672

This is not graded assignment.

Instructions
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).
An example of the program is shown below:
Enter file name: Ch11_Ex5Data.txt
Welcome to the address book program.
Choose among the following options:
1: To see if a person is in the address book
2: Print the information of a person
3: Print the names of person having birthday in a parti
4: Print the names of persons between two last names
5: Print the names of persons having a particular statu
6: Print the address book
7: Save data
9: Terminate the program
2
Enter the last name of the person: Balto
Brave Balto
Date of Birth: 2-6-1975
Phone Number: 415-782-5555
Person Type: Business
Disney Road
Orlando, Florida 35672
FILETREE
~/sandbox
Ch11 Ex5Data.txt
Ch11 Ex5Out.txt
addressBookType.h
addressBookTypel...
addressType.h
addressTypelmp.c...
dateType.h
dateTypelmp.cpp
extPersonType.h
extPersonTypelm...
main.cpp
personType.h
personTypelmp.c...
main.cpp x address... x address... X extPerso... X extPerso... X
1 #include "extPersonType.h"
2
3
4 class addressBook Type
5 {
6 public:
7 void add_person(extPersonType person);
8 extPersonType getPerson(int index) const;
9 extPersonType search(const string& last_name) const;
10 void printPerson(int index) const;
11 void printInMonth(int month) const;
12 void printBetween LastNames (const string& first, const string& last)
13 const;
14 void printInTypes (TYPES type) const;
15
16
address... X
17 private:
18 extPersonType [500];
19 int current_index = 0;
20 }
21
+
>_ Terminal
sandbox $
X
+
Transcribed Image Text:Instructions 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). An example of the program is shown below: Enter file name: Ch11_Ex5Data.txt Welcome to the address book program. Choose among the following options: 1: To see if a person is in the address book 2: Print the information of a person 3: Print the names of person having birthday in a parti 4: Print the names of persons between two last names 5: Print the names of persons having a particular statu 6: Print the address book 7: Save data 9: Terminate the program 2 Enter the last name of the person: Balto Brave Balto Date of Birth: 2-6-1975 Phone Number: 415-782-5555 Person Type: Business Disney Road Orlando, Florida 35672 FILETREE ~/sandbox Ch11 Ex5Data.txt Ch11 Ex5Out.txt addressBookType.h addressBookTypel... addressType.h addressTypelmp.c... dateType.h dateTypelmp.cpp extPersonType.h extPersonTypelm... main.cpp personType.h personTypelmp.c... main.cpp x address... x address... X extPerso... X extPerso... X 1 #include "extPersonType.h" 2 3 4 class addressBook Type 5 { 6 public: 7 void add_person(extPersonType person); 8 extPersonType getPerson(int index) const; 9 extPersonType search(const string& last_name) const; 10 void printPerson(int index) const; 11 void printInMonth(int month) const; 12 void printBetween LastNames (const string& first, const string& last) 13 const; 14 void printInTypes (TYPES type) const; 15 16 address... X 17 private: 18 extPersonType [500]; 19 int current_index = 0; 20 } 21 + >_ Terminal sandbox $ X +
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer