/* Fraction.txt documents class Fraction. ==> Put your "usual" information here: name, course, etc. ------------------------------------------------------------------*/ // replace this line with the beginning of class Fraction /* Fraction default-value constructor function.---------- Precondition: A Fraction object has been declared. Postcondition: myNumerator == 0 && myDenominator == 1. ----------------------------------------------------------*/ // replace this line with the prototype of the first Fraction constructor /* Fraction explicit-value constructor function.---------- Precondition: A Fraction object has been declared. Receive: numerator, denominator, two integers. Postcondition: myNumerator == numerator && myDenominator == denominator. ----------------------------------------------------------*/ // replace this line with the prototype of the second Fraction constructor /* Numerator extractor ----------------------------------- Return: the value of myNumerator. ----------------------------------------------------------*/ // replace this line with the prototype of getNumerator() /* Denominator extractor -------------------------------- Return: the value of myDenominator. ----------------------------------------------------------*/ // replace this line with the prototype of getDenominator() /* Input function member -------------------------------- Receive: in, an istream. Precondition: in contains a Fraction n/d. Input: n/d via in. Passback: in, with n/d extracted from it. Postcondition: myNumerator == n && myDenominator == d. ----------------------------------------------------------*/ // replace this line with the prototype of read() /* Output function member ------------------------------- Receive: out, an ostream. Output: myNumerator and myDenominator via out. Passback: out, containing the output values. ----------------------------------------------------------*/ // replace this line with the prototype of display() /* operator* -------------------------------------------- Receive: rightOperand, a Fraction object. Return: result, the product of the receiver of this message and rightOperand. ----------------------------------------------------------*/ // replace this line with the prototype of operator* /* Simplify a Fraction from improper to proper. --------- Postcondition: the Fraction receiving this message is a proper fraction. ----------------------------------------------------------*/ // replace this line with the prototype of simplify() // replace this line with the end of class Fraction // *** Non-Member Operations ***// /* operator<< ------------------------------------------- Receive: out, an ostream object, aFraction, a Fraction object. Pass Back: out, with aFraction inserted into it. Return: out (for chaining). ----------------------------------------------------------*/ // replace this line with the prototype of operator<< /* operator>> ------------------------------------------ Receive: in, an istream object, aFraction, a Fraction object. Pass Back: in, with a fraction extracted from it. aFraction, filled with that fraction. Return: in (for chaining). ----------------------------------------------------------*/ // replace this line with the prototype of operator>>