Question: please help me on this c++ program using Pointers, Polymorphism, and Memory Allocation . Instructions: To complete this I need to do the following: Create

please help me on this c++ program using Pointers, Polymorphism, and Memory Allocation.

Instructions:

To complete this I need to do the following:

  1. Create a class called IntVector, this class will specifically store integers only.
  2. Your class should have a private member variable of type int pointer. This is the variable that will dynamically create integer arrays to store your integers.
  3. Create a function called add , which is used to add new integers to your dynamic array.
  4. Create a function called get, which has an integer, named index as a parameter, and will return the the value stored at index in your dynamic array.
  5. You should also have a function called resize, which will double the size of the dynamic array once the array is full. This function should be called in your add function. If a new integer is being added to your dynamic array, and your dynamic array has reached full capacity, the IZ function should be called to add more capacity to the dynamic array.
  6. Lastly, create a function named, size, which returns the number of elements that have been added to your IntVector

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!