This lab is due by Wednesday, April 13, 2022 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab.  If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.
Instructions
For this lab, we will continue to make our sorting more flexible.
Begin by creating a Rectangle class. The class will need data members to store the base and height (as floats) plus the appropriate getters/setters for each. Have the constructor set each to be 1 by default.
We will want to be able to compare two Rectangles as well. Overload the < and > operators. These operators are resolved as follows:
- 
        
rect1 < rect2:rect1is less thanrect2if thebaseofrect1is less than thebaseofrect2OR thebases are equal and theheightofrectis less than theheightofrect2 - 
        
rect1 > rect2:rect1is greater thanrect2if thebaseofrect1is greater than thebaseofrect2OR thebases are equal and theheightofrectis greater than theheightofrect2 
Make a list of Rectangles (array or LinkedList). Now modify one of your previous sort methods (selection, insertion, bubble, merge) to accept a function pointer for how to do the comparison when sorting. Create an ascending function and a descending function that can be used as the comparing function.
To test your implementations, perform the following steps:
- Ask the user how many Rectangles to create
 - Create a list of 
nRectangles - Assign each a random base and height
 - Print the list forwards (print the rectangle as 
basexheight) - Sort the list ascending
 - Print the list forwards (print the rectangle as 
basexheight) - Sort the list descending
 - Print the list forwards (print the rectangle as 
basexheight) 
Lab Submission
Submit your main.cpp, Makefile, *.hpp, *.h, *.cpp file(s).
You will submit your solution to this lab with the rest of Set5. Detailed instructions for doing this are posted in Assignment 5.
This lab is due by Wednesday, April 13, 2022 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab.  If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.