Question
Given the class PhoneBook below: class PhoneBook { private: int max; int curr; Enrty *Entries; void Expand(); int Find(); public: PhoneBook(); ~PhoneBook(); void add ();
Given the class PhoneBook below:
class PhoneBook
{
private:
int max;
int curr;
Enrty *Entries;
void Expand();
int Find();
public:
PhoneBook();
~PhoneBook();
void add ();
void Remove()
void Display() const;
};
Modify the class according to the following:
1. Create phone book that can store 20 entries.
2. Write the appropriate code for the destructor.
3. Write the code of the add, remove and display functions.
4. Explain why Display function is made constant.
Write a driver program that will do the following:
5. Define an array of 10 PhoneBook objects.
6. Fill the array from the user until all phone books are full.
7. Print the contents of all phone books to the screen.
8. Create and Entry object and read the values from the user.
9. Let the user enter a phone number and delete the corresponding entry from the correct phone book.
10. Compare the entries of any of the two phone books you created.
11. Print the contents of all phone books to the screen.
(Note that you should separate the interface form the implementation for all of your code.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started