Define a class called Rational. The class will represent objects that are rational numbers or what we
think of as fractions. Your class should have two integer member variables, one that represents the
numerator of a rational number and one that represents the denominator. Write three constructors for
your class: a default constructor that constructs the fraction 0/1, a single argument constructor that
constructs a given integer value into a rational number by placing it as the numerator/1 and finally a two
argument constructor that allows the user to select both a numerator and denominator for your rational
number. The last constructor can be a bit tricky because it allows the user to give you values that are not in
simplest form for example they could ask you to construct the fraction 4/2 which should be stored
internally as 2/1. How can this be done? Take a look at the Euclidean algorithm for computing the
greatest common divisor of two numbers (search the web). Implement this function as a helper
function (private function) that your class can use when simplifying fractions.
Lastly, for this assignment, overload the << operator so that you can output objects of type Rational to the given stream so that they appear as numerator / denominator. class_cpp.png Unformatted Attachment Preview ... Purchase answer to see full attachment