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.
Get Free Quote!
276 Experts Online