I have a
question about the
2nd question of assignment 02.
How do you want me to implement the add, sub, mul, and div member functions? Must a.add(b) affect the nominator / denominator values of object a, or must it return a third object of type Fraction containing the result?
I’ve also noticed that the formula for “Product of two fractions†is incorrect. Must I use correct one of (ac)/(bd)?
Reply:
a.add(b) should not affect a or b at all, i.e. it should return a third object of type Fraction. You should be able to use it as follows:
c = a.add(b);
Also, please use the correct formula (ac)/(bd) for the product of two fractions. Apologies for the mistake.