Consider the following base class: class Comparer { public: virtual boolean firstOnLeft(string str1, string str2); } Your task for this problem is two-fold

computer science

Description

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.

Instruction Files

Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.