consider we have two similar classes which work on numbers and return some values.
ClassA and ClassB
ClassA works on floats and returns the abs of the input value.
ClassB works on DWORD values and returns the sum of input values.
both have the function Work() which acts on input and returns the result.
we need a class ClassC which merges abilities of ClassA and ClassB.
and then just create an instance of ClassC , give the input and get the return value.
ClassC should have a function Work() which acts on input and returns the result.
could any one tell me how to do that please?
could this problem be solved by Inheritance or polymorphism?