Question: Instructions Create a new templated class called Sorted Collection that inherits the Collection class. Add the following items to the Sorted Collection class. Create

Instructions Create a new templated class called Sorted Collection that inherits the Collection class. Add the following items to the Sorted Collection class. Create an additional overload operator for the + operator. This will you practice with overloaded operators. This time we will use it to add and Item to the Collection class (and thus Sorted Collection class). When implementing the operator, you are welcome to call the add method that has already been coded. Create an additional overload operator for the < < operator. This time we will use it to add and Item to the Collection class (and thus Sorted Collection class). This will NOT be a friend function. Watch out, there will be different parameters than the operater < < used to display the object. When implementing the operator, you are welcome to call the add method that has already been coded. Overload the three constructors such that you can make a call to Sorted Collection using no parameters, a single int parameter to specify the max size, and with a parameter of another Sorted Collection to start with a given collection. Overload the add method such that it adds items in the correct order from lowest to highest. For example, given a collection with the following values 2 5 9, add(3) would produce 2 3 59. Collection.h #ifndef COLLECTION H #define COLLECTION_H #include #include #include #include using namespace std; template class Collection; template ostream& operator
Step by Step Solution
3.23 Rating (164 Votes )
There are 3 Steps involved in it
template class SortedCollection public Collection public Additional constructor overloads SortedCollection Collection SortedCollectionint size Collectionsize SortedCollectionSortedCollection a Collect... View full answer
Get step-by-step solutions from verified subject matter experts
