Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ coding please Given the following class definition: class Entry Private string name: int phone Number string address; public: Entryo: void setvals(string, int, string): void

C++ coding please image text in transcribed
image text in transcribed
Given the following class definition: class Entry Private string name: int phone Number string address; public: Entryo: void setvals(string, int, string): void display const; int getPhoneNumber(); -Entry; }; Modify the class according to the following: 1. Add a private static integer data member named NumEntries that must be Incremented whenever a new entry object is created. Decremented whenever an entry object is destroyed. 2. Add a public static getter function for NumEntries. Write the code for the display function using this pointer. 4. Implement a friend functions that compares two entries: int computeDistance(Soccer Player & pl. Soccer Player & p2) Given the class Phone Book below: class Phone Book private: int max: int curr. Enrty Entries, void Expando): int Findo): public: PhoneBook(): -PhoneBook): void add : void Remove void Display() const; a) 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: 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

4. What are the current trends in computer software platforms?

Answered: 1 week ago