Consider the following base class: class Comparer { public: virtual boolean firstOnLeft(string str1, string str2); } Your task for this problem is two-fold: Write a method string getLeftmost(Comparer* comp, string a, string b); that returns the string that should be left-most (either a or b). Implement class LengthBased: public Comparer, providing a definition for the firstOnLeft() method seen above in the derived class by taking the shorter string as the left-most, or the first if they are of equal length.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |