Question: In C++ please HOMEWORK 35-Dynamic Arrays as -Vectors One problem with dynamic arrays is th. once the array is created using the new operator, te

 In C++ please HOMEWORK 35-Dynamic Arrays as -Vectors One problem with
dynamic arrays is th. once the array is created using the new
In C++ please

HOMEWORK 35-Dynamic Arrays as -Vectors One problem with dynamic arrays is th. once the array is created using the new operator, te size cannot be changed. For example, you might want to add or delete entries from the array as you can with a vector. This homework problem asks you to create functions that use dynamic arrays to emulate the behavior of a vector Use the following function prototypes: string addEntry (string "dynamicAzzay. int &size, string nevEntry) This function should create a new dynamicArray one element larger then dynamicArray,copy all elements from dynamicArray into the new aray, add the new entry intoe end of the new array. increment the size, delete dynamicArray, and seturn the new dynamic array string deleteEntry (string "dynanichrray, int isize, string entryToDelete) : This function should search dynamicarray for entryToDelete. If not found, the request should be ignored and the unmodified dynamicArray returned. If found create a new dynamic array one element smaller than dynamicArray. Copy all elements except entryToDelete into the new array, delete dynamicarray, decrement size, and return the new dynamic array void output (string "dynamicArzay, int size) This function should print each string stored in dynamicArray to the screen. Print a return character after each string entry is printed. Test your functions by creating following strings in each of the elements of the array an initial variable length array with 5 string elements. Store the "Gregory". "Bobby", "Helen". "Raylan", and-Ava- Then perform the following actions: I. 2. 3. 4. Print the array Add "Kristin" to the array Print the array Delete "Greg" from the array . Print the array 6. Delete "Gregory from the array 7. Print the array 8. Delete "Kristin from the array 9. Print the array 10. Delete "Helen" from the array 11. Print the array. If you execute the program, the following information should be displayed main.o Output 1: Gregory

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!