Question: write the following in c++ and i have this code for the first part class Entry { private: string name; int phoneNumber; string address; int

write the following in c++

write the following in c++ and i have this code for the

and i have this code for the first part

class Entry { private: string name; int phoneNumber; string address; int salary; static int NumEntries; // private static integer data member public: Entry(); void setVals(string, int, string, int); void display(); int getPhoneNumber(); int getNumEntries(); // public static getter method for NumEntries friend int compareSalary(Entry&, Entry&); ~Entry(); }; // Constructor Entry:: Entry() { NumEntries++; } // display function using this pointer void Entry:: display() { cout name phoneNumber address  e2.salary) { return 1; } return 0; } 

first part class Entry { private: string name; int phoneNumber; string address;

 

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; a) Modify the class according to the following: 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: 1. Define an array of 10 PhoneBook objects. 2. Fill the array from the user until all phone books are full. 3. Print the contents of all phone books to the screen. 4. Create and Entry object and read the values from the user. 5. Let the user enter a phone number and delete the corresponding entry from the correct phone book. 6. Compare the entries of any of the two phone books you created. 7. 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. 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; a) Modify the class according to the following: 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: 1. Define an array of 10 PhoneBook objects. 2. Fill the array from the user until all phone books are full. 3. Print the contents of all phone books to the screen. 4. Create and Entry object and read the values from the user. 5. Let the user enter a phone number and delete the corresponding entry from the correct phone book. 6. Compare the entries of any of the two phone books you created. 7. 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

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!