Question: (Modify) a. Include a member function named gcd() in the Fractions class constructed for Exercise a that reduces a fraction to its lowest common terms,

 (Modify) a. Include a member function named gcd() in the Fractions

(Modify) a. Include a member function named gcd() in the Fractions class constructed for Exercise a that reduces a fraction to its lowest common terms, such as reducing the fraction 2/4 to 1/2. This is done by dividing both the numerator and denominator values by their greatest common divisor (See Exercise in "Programming Projects for Chapter 6 for a description of finding the greatest common divisor of two numbers.) b. Modify the overloaded operator constructor written for Exercise 5a to include a call to gcd) so that each overloaded operator function uses gcd0 to return a fraction in lowest common terms

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!