Implement the following class MyPhoneBook. You can add additional private member variables and functions.The class has the following private member variables:1- names and phones: Dynamic arrays of strings.2- phoneBookSize: An int that holds size of phonebook.The Class has the following public member functions:1- Parametrized Constructor that takes the size of PhoneBook and allocate dynamic arrays of names and phones and a copy constructor to initialize a PhoneBook using another PhoneBook.2- A function addEntry that adds a name and phone number at the first empty space at corresponding arrays, and returns true if entry is added, false otherwise. An entry is added if there’s space in the array and if phone number if valid. It checks for the validity of the phone number by ensuring that it has 11 digits, and doesn’t include any alphabets or special characters.3- A function displayEntryAtIndex(int) that displays a name and phone number at the specified index. It returns true if the index is in range, false otherwise.4- A function displayEntryAtIndices(int*) that receives an array of zeros and ones and has the same size of the class arrays. The function displays the name and phone number of an entry in the array only if the corresponding integer in the parameter array is one.5- A function displayAll() that displays all entries in the phone book.6- A function findByName(string) that search in PhoneBook either by full name or a partof a name and returns an array of int with the same size of PhoneBook. The array isfilled with values 0 or 1. Value 0 if name is not a match and 1 otherwise.7- A function findByPhone(string) that search in PhoneBook either by full phone numberor a part of a phone number and returns an array of int with the same size of PhoneBook,The array is filled with values 0 or 1. Value 0 if phone number not a match and 1otherwise.8- A function updateNameAt(string,int) to update name in PhoneBook at specific index. Itreturns a bool which is true if the parameter index is within range and name is updated.9- A function updatePhoneAt(string,int) to update phone number in PhoneBook at specificindex. It returns a bool which is true if the parameter index is within range and phone isupdated.10-A Destructor to deallocate dynamic arrays and leave no memory leak.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here