Question: You to create a class calledDynamicStringArraythat includes member functions that allow it to emulate the behavior of a vector of strings. The class should have

You to create a class calledDynamicStringArraythat includes member functions that allow it to emulate the behavior of a vector of strings. The class should have the following: A private member variable calleddynamicArraythat references a dynamic array of type string. Aprivate member variable calledsizethat holds the number of entries in the array. Adefault constructor that sets the dynamic array toNULLand setssizeto 0. Afunction that returnssize. Afunction namedaddEntrythat takes a string as input. The function should create a new dynamic array one element largerthan dynamicArray, copy all elements fromdynamicArray into the new array, add the new string onto the end of the new array, incrementsize, delete the olddynamicArray, and then setdynamicArrayto the new array. A function nameddeleteEntrythat takes a string as input. The function should searchdynamicArrayfor the string. If not found, it returns false. If found, it creates a new dynamic array one element smaller thandynamicArray.It should copy all elements except the input string into the new array, deletedynamicArray,decrementsize,and return true. You to create a class calledDynamicStringArraythat includes member functions that allow it to emulate the behavior of a vector of strings. The class should have the following: A private member variable calleddynamicArraythat references a dynamic array of type string. Aprivate member variable calledsizethat holds the number of entries in the array. Adefault constructor that sets the dynamic array toNULLand setssizeto 0. Afunction that returnssize. Afunction namedaddEntrythat takes a string as input. The function should create a new dynamic array one element largerthan dynamicArray, copy all elements fromdynamicArray into the new array, add the new string onto the end of the new array, incrementsize, delete the olddynamicArray, and then setdynamicArrayto the new array. A function nameddeleteEntrythat takes a string as input. The function should searchdynamicArrayfor the string. If not found, it returns false. If found, it creates a new dynamic array one element smaller thandynamicArray.It should copy all elements except the input string into the new array, deletedynamicArray,decrementsize,and return true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
