Question: 3 . 3 Required methods: ContactBook class Default Constructor Find - Takes in a string that can either be a phone number or a name
Required methods: ContactBook class
Default Constructor
Find Takes in a string that can either be a phone number or a name and returns the found contact as a pointer. Returns a nullptr if a given string is not a name or a number in the contact system.
Add Tabes in a contact object and stores its memory address in the furthestmost empty position in the array. The current order of contacts in the array must be preserved. Note: passing by value will result in a garbage pointer It returns nothing. Also know that there will never be a test case that tries to add a Contact that already exists in the ContactBook, and this applies for all the addition functions, even the operators.
AddContacts Takes in a vector of contact pointers, and stores all of it's values in the class's array, in the same order that they were in the vector. It returns nothing.
Remove Takes in a contact object, and removes the acsociated contact from the array. See the note in Add The rest of the contacts should stay in the same order in the array, which may mean you would have to shift all the pointers ahead in the array back one place. It returns nothing.
Display Displays each contact in the contact book, in the order that they are stored in the array. For example like this:
Roland,
Andres,
George,
Lily,
Justin,
Alphabetize sorts the array in alphabetical order based on contact name. Note that in this special case, Albert would come before Alberta. This should be the only function that can alter the order that the contacts are stored in the array.
the following operators:
@ Contact Adds a single contact to a ContactBook object
@ ContactBook Adds all contacts from the passed in ContactBook to this object. Adding them to the back in the order they are in the other ContactBook's array.
ContactBook Adds two contact books together and returns the resulting ContactBook.
Contact Removes the Contact that matches the passedin Contact.
o ContactBook Removes all contacts from a passed in ContactBook from this object
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
