This program will store in miniVector v a list of 15 random integers from 0 to 99, then it will output the vector, sort the vector, then output it again sorted.
Program Definition
1. Create program definition with the following templates and methods:
// output miniVector v
template <typename T>
void writeMiniVector(const miniVector<T>& v);
// use insertion sort to place miniVector v in descending order
template <typename T>
void sortMiniVector(miniVector<T>& v);
Main Method
1. Declare: miniVector<int> v;
2. Declare: randomNumber rnd;
3. call v.push_back(rnd.random(100)); to push 15 entries from 0-99 onto the vector
4. call writeMiniVector to output vector
5. call sortMiniVector to sort the vector
6. call writeMiniVector to output the sorted vector.
After you output the sorted vector:
Include: system("PAUSE"); after your output to pause the screen.
writeMiniVector Method (const miniVector<T>& v)
1. Iterate through the vector v and output each element to the screen.
sortMiniVector Method (miniVector<T>& v)
1. Sort the elements of vector v.
2. Since it is passed-by-reference, no return is necessary.
I have two files that I have to use called d_random.h and d_vector.h that I can use. and I see according to the instructions I am assuming void writeMiniVector(const miniVector<T>& v); and void sortMiniVector(miniVector<T>& v); are going to be my methods with the template being template <typename T>