Question
C++ code Implement a program that will manage a several contact books of different people, using classes.The program should be command-line interfaced. your contact book
C++ code
Implement a program that will manage a several contact books of different people, using classes.The program should be command-line interfaced.
your contact book class should do: 1) Your add contact function will now add a contact in a sorted order 2) Your delete contact function will preserve the sorted order of the contacts 3) Provide a private sort function which will sort the contact list internally 4) Provide a merge function that will merge the second contact list into the first
Your main program will store up to 5 contact books read from a file. You will never have more than 5 contact books . The main program should start by reading the file contactbooks.txt to create contact book objects dynamically and store them as pointers in an array of capacity 5. The format of the file will be:
Owner-first-name|Owner-last-name
first-name|last-name|phone|email|home|street|apt|city|state|zip
first-name|last-name|phone|email|home|street|apt|city|state|zip
first-name|last-name|phone|email|home|street|apt|city|state|zip
endofbook|
Owner-first-name|Owner-last-name
first-name|last-name|phone|email|home|street|apt|city|state|zip
first-name|last-name|phone|email|home|street|apt|city|state|zip
first-name|last-name|phone|email|home|street|apt|city|state|zip?
endofbook|
Owner-first-name|Owner-last-name
first-name|last-name|phone|email|home|street|apt|city|state|zip
first-name|last-name|phone|email|home|street|apt|city|state|zip
first-name|last-name|phone|email|home|street|apt|city|state|zip?
endofbook|
The program will have a menu with the following options:
1) create a new contact book (note: you will only be able to create up to five contact books. If you attempt to create more, the program should report an error)
2) remove a contact book (identified by owners name)
3) display all contact books (in your system)
4) merge two contact books (both books are identified by owners name)
5) select a contact book (identified by owners name) to perform following
operations: a) add new contact
b) delete old contact
c) display contact info d) update contact info e) display entire contact book
6) Exit
Note: When you start the program the contact books must be read in from a file calledcontactbooks.txt. When you exit a program the contact books must be stored back to a file called contactbooks.txt. Internally in your program contact books are stored in an array of capacity 5.
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