Lab 2a: Unsorted Phone Book

We are in need of a phone book which we can store contacts – individuals’ first names and phone numbers. Your list of contacts will be unsorted.

For the implementation, you will need a class for Contact objects. The Contact class will contain the contact attributes: first name and phone number.

You will keep the list of Contact instances in a second class, the AddressBook container class. This container class will have an aggregate relationship with the Contact class. This means it will contain and maintain the unsorted list of Contacts.

The AddressBook container class should implement an array style list of Contact objects. C++ vectors are not allowed for Lab 2a.

When the program starts it should open to a main menu with these choices:

  1. Add Contact
  2. Find Contact
  3. Edit Contact
  4. Delete Contact
  5. Display Current Contact
  6. Display All Contacts

Your phone book app needs to be structured like this:

  • Put each class in its own .cpp file. Each class also needs its own .h file
  • Put your menu and app code that uses the classes in main.cpp
  • Use the starter .h files provided here.
  • Your first step should be to create the .cpp file for each class, with empty functions implementing the class members, and a main.cpp file with the necessary #includes but just outputs “Hello, World!”
  • Second step: compile and link the first step above with no errors or warnings.
  • Third step: implement the Phone Book functionality with an unsorted array list.
  • If you have trouble, come to my office hour and the Friday 10am Zoom meeting.
  • Don’t forget to comment your code!

Lab 2b: Persistent AddressBook using Sorted Linked List

You will begin Lab 2b with your completed code for Lab 2a. Modify your Lab 2a code to:

  1. maintain an alphabetically sorted list of Contacts
  2. use a sorted linked list instead of an array.
  3. store Contacts to a datafile.
  4. If the datafile already exists, your app will populate the AddressBook list with Contacts from the file.

You should be able to just change the private members of the AddressBook class, and your AddressBook.cpp code. Start with this .h file:

Looking for solution of this Assignment?

WHY CHOOSE US?

We deliver quality original papers

Our experts write quality original papers using academic databases.  

Free revisions

We offer our clients multiple free revisions just to ensure you get what you want.

Discounted prices

All our prices are discounted which makes it affordable to you. Use code FIRST15 to get your discount

100% originality

We deliver papers that are written from scratch to deliver 100% originality. Our papers are free from plagiarism and NO similarity

On-time delivery

We will deliver your paper on time even on short notice or  short deadline, overnight essay or even an urgent essay