Question: in c++, Create a PhoneBook class. This class should allow a user to to enter up to 100 entries. Each entry contains the first name,

in c++,

Create a PhoneBook class. This class should allow a user to to enter up to 100 entries. Each entry contains the first name, last name and phone number. Your class should allow users to do the following:

  • Enter a new phone number
  • Edit an existing phone number
  • lookup a phone number by first name or last name
  • lookup a phone number by full name
  • lookup a name by phone number
  • list all entries
  • Save entries to a file
  • read entries from a file

Your class should a constructor that takes a filename as its argument. This constructor will load all the entries from the file to the phonebook.

When a user adds a new entry, it should automatically save the entry to the file.

Remember this is a class, so please do not have your driver program included. You are to write a driver program that uses your class. None of the member functions in your class should use cout or cin, your driver program should do that. However your class should use ifstream and ofstream to read and write to the file.

Please make sure that your class declaration is in the header file (.h) and your class implementation is in the source file (.cpp)

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!