Question
I just need help with the following two parts of this code. I will post the DynamicArray.cpp and Main.cpp that runs it. Can you please
I just need help with the following two parts of this code. I will post the DynamicArray.cpp and Main.cpp that runs it. Can you please just help me with these requirements
implement a dynamic array by completing the class called MyDynamicArray. The MyDynamicArray class should manage the storage of an array that can grow and shrink.You should complete the class by writing the add and del methods. When you need to grow the array size, the add method should print out the message Doubling to : followed by the new size of the array. When the del method shrinks the size of the array, print out the message Reducing to : followed by the new size of the array.
--------------------------------------------------------------------------------------------
#include
-------------------------------------------------------------------------------------------
#include
void foo(MyDynamicArray param) { for(int i=0; i int main() { MyDynamicArray x; for (int i=0; i<130; i++){ x.add(i); } int sum = 0; for (int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started