() Write a free function void reduce rational (Rational & r) that reduces r completely using god. Extend RationalCpp wit
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
() Write a free function void reduce rational (Rational & r) that reduces r completely using god. Extend RationalCpp wit
() 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!