Question: ***please do it in c++*** 1 - Objective The purpose of this assignment is for students to gain a better understanding of pointers and dynamic

 ***please do it in c++*** 1 - Objective The purpose of

this assignment is for students to gain a better understanding of pointers

and dynamic allocation, along with reinforcing their knowledge of arrays 2 -

Problem Write a program that: Creates a dynamic array of integers (int)

***please do it in c++***

1 - Objective The purpose of this assignment is for students to gain a better understanding of pointers and dynamic allocation, along with reinforcing their knowledge of arrays 2 - Problem Write a program that: Creates a dynamic array of integers (int) starting size 2 + This will be used to store user input elements. Create a menu interface with the options: Print Element, Add Element, Delete Element, Return Size, and Exit. This will be how the user interacts with the array. (Note: You can look over the Sample Output section to see how the user interacts with the menu) + Print Elements: This option will print all the elements currently stored in the array. If there are no elements in the array, it prints out "No elements" (without quotes) + + + Add Element: This option asks the user to input a number to store into the array, then inserts the number in the arrav. + + If the array does not have room to add another element, the array should be expanded to 2 times its current size before adding the element. Print a message "Array expanded" (without quotes) whenever the size doubles. Anytime the array size is changed, you should copy the old array elements into the new one and deallocate the old one to prevent memory leaks + +

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!