- Create a class called “BubbleStorage”.
- Internally use a “vector” from the STL to store the data.
- Write a method that will add data to the vector.
- Write a method that will display the in the array (use an iterator to access each element)
- Write a Max method that will sort the internal vector by using a "Bubble Sort" algorithm and sort with largest value first .
- Write a Min method that will sort the internal array using a Bubble sort with the smallest value first.
- In the “main” of your program
- Call rand() to get a number between 25 and 75
- Add that many numbers to the BubbleStorage class
- Print out the array that is stored by overloading the "<<" operator for your class. (Your code should be Example: cout << bublesort << endl;)
- Print out the array both max sorted and min sorted.
Note: How much easier it is to use a Vector. Notice that you did not need to know the size of the array before using or declaring it.
I need source code, the C++ exe file, and a screenshot! Thanks!
Please Login or Register
to Submit the Solution for the Request