Create a \"Dynamic Array\" container with this user interface: // Gets the current number of entries in container int getCurrentSize() // Returns the current capacity of the container int capacity() // Checks whether the container is empty. boolean isEmpty() // Adds a new entry to the container boolean insert(newEntry) // Removes an entry from the container and moves all entries above anEntry down one boolean remove(anEntry) // Get index value int getValue(index) // Removes all entries from the container void clear() // Resize a container by doubling current capacity int resize() * Implement dynamic resizing using this algorithm: 1. Starting with a dynamic size of 10, if the number of elements exceed this number: a. Reallocate the container size to double the current size b. Move the contents of the current container to the newly sized container c. Delete the previously sized container. Resize C++ Data* ptemp = new Data[capacity*2 ]; for (int i=0; i Solution container.cpp --- #include #include using namespace std; template class DynamicArray { /* Container class DynamicArray */ private: ArrayType *arr; int entry,size; public: DynamicArray(); ~DynamicArray(); int getCurrentSize() { return entry; };/*this function returns total number of entries in the container*/ int capacity() { return size; };/*this function returns capacity of the container*/ bool isEmpty(); bool insert(ArrayType); bool remove(ArrayType); int getValue(ArrayType); void clear() { entry = 0; };/*this function clears the whole container*/ int resize(); }; template int DynamicArray::resize() { /*this function resizes the container by doubling its previous size*/ ArrayType *temp = NULL; try { temp = new ArrayType [2 * size]; }catch(bad_alloc xa){ cout<<\"\ Array allocation failed\ \"; exit(1); } size *= 2; for(int i = 0 , j = 0 ; i < entry ; i++) { temp[i] = arr[i]; j++; } delete [] arr; arr = NULL; arr = temp , temp = NULL; return size; } template int DynamicArray::getValue(ArrayType index) { /*this function return index of an element specified as index in the container if it presents in the container, else it returns -1*/ int loc = -1; for(int i = 0 ; i < entry ; i++) { if(arr[i] == index) { loc = i; break; } } return loc; } template bool DynamicArray::remove(ArrayType anEntry) { /*this function removes an element specified as anEntry from the container and returns true and decrements total number of entries by one else returns false*/ bool flag = false; int index = -1; for(int i = 0 ; i < entry ; i++) { if(arr[i] == anEntry) { index = i , flag = true; break; } } for(int i = index ; i < (entry - 1) && flag == true ; i++) { arr[i] = arr[i+1]; } if(flag == true) entry -= 1; return flag; } template bool DynamicArray::insert(ArrayType newEntry) { /*this function inserts an element specified as newEntry in the container, if it successfully inserts an element then it returns true and increments total number of entries by one, else it returns false*/ entry += 1; if(entry <= size) { ar.