() Write a free function void reduce rational (Rational & r) that reduces r completely using god. Extend RationalCpp wit
Posted: Sat May 14, 2022 4:20 pm
() Write a free function void reduce rational (Rational & r) that reduces r completely using god. Extend RationalCpp with the method void reduce(), which completely reduces the instance on which it is called using gcd. How can you deal sensibly with a negative numerator or denominator? Explain your approach. 3 points (vi) Now modify the functions/methods and constructors that you have defined in ) and I so that fractions are always irreducible. Use the function/method that you have defined in for this purpose. Why is it impossible to ensure that this invariant is always maintained in RationalC? 3 points