Question: in c++ 8. Rational Arithmetic I A rational number is a quotient of two integers. For example, 12/5, 127-4, -3/4, an 4/6 are all rational


in c++
8. Rational Arithmetic I A rational number is a quotient of two integers. For example, 12/5, 127-4, -3/4, an 4/6 are all rational numbers. A rational number is said to be in reduced form it is denominator is positive and its numerator and denominator have no common diviso other than 1. For example, the reduced forms of the rational numbers given above are 12/5,-3/1, -3/4, and 2/3. Write a class called Rational with a constructor Rational(int, int) that takes two integers, a numerator and a denominator, and stores those two values in reduced form in corresponding private members. The class should have a private member function void reduce() that is used to accomplish the transformation to reduced form. The class should have an overloaded insertion operator
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
