Question: Create a class template to store a partially filled array. The class will store an array of up to 10 items of any type. You

Create a class template to store a partially filled array. The class will store an array of up to 10 items of any type. You will statically allocate a 10 item array of template type T and then use an integer variable to specify how much of the array is actually in use at the current point in time (the effective size): 0 2 7 8 Effective Size - 7 Remember, your entire template class will be written in the header file because template classes can't be split into header and implementation files. Your class should have the following template member functions: Default Constructor - initializes the effective size to zero (since the array starts out with nothing in it) but does NOT initialize the array. * * print : displays the contents of the partially filled array (you can choose how to separate the items, e.g. by endlines, spaces, commas, etc) add1lement adds the item passed in as a parameter to the end of the array and adjusts the effective size to match. If the array is already full then it ignores the new item and leaves the array unchanged. reroveElement: is passed an index as a parameter and removes the item at that index from the array and shifts all the remaining items down to the right, so that the array doesn't have a gap in it - don't forget to update the effective size. largest: should return the largest item in the partially-filled array. ' In main,(), you should: Create a partially filled array of whatever type you choose, e.g, ints, strings, doubles. NOTE: The syntax for creating an object from the template would look something like: PFarray
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
