#ifndef RESIZABLE_ARRAY_H #define RESIZABLE_ARRAY_H #include "Exceptions.h" const unsigned long DEFAULT_ARRAY_CAPACITY = 10; // capacity used in no arg constructor template class ResizableArray { private: unsigned long capacity = DEFAULT_ARRAY_CAPACITY; // maximum capacity, in items unsigned long size = 0; // actual number of items currently in array T* data = NULL; // pointer to array of any type void doubleCapacity(); // method to double array capacity void halveCapacity(); // method to halve array capacity public: ResizableArray(); // constructs array with default capacity ResizableArray(unsigned long capacity); // constructs array with specified capacity virtual ~ResizableArray(); // frees array space as object is deleted void add(T item); // adds item, increments size, doubles capacity as necessary // all indexed member functions must throw ExceptionIndexOutOfRange for bad index values void addAt(T item, unsigned long index); // adds item at index, shifts following, doubles capacity as necessary void replaceAt(T item, unsigned long index); // replaces item at index, otherwise unchanged void removeAt(unsigned long index); // removes item at index, shifts following back T get(unsigned long index) const; // returns (copy of) item at index T operator[](unsigned long index) const; // returns (copy of) item at index unsigned long getSize() const; // returns number of items currently in array unsigned long getCapacity() const; // returns the current capacity of the array }; // Add your implementation below this line. Do not add or modify anything above this line. #endif