So this is just my assignment. Were given this code to start out with, i'm just trying to understand what does it exactly do and what its passing in as the parameters. So op is the RHS pretty much the method is multplies RHS with the fraction object invoked with this method.
Any help would be appreciated it thanks!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "Fraction.h"
#include "GCD.h" // template function for calculating greatest common divisor
#include <iostream>
usingnamespace std;
//Implementation of the timesEq() member function
//Performs similar operation as the *= operator on the built-in types
const Fraction & Fraction::timesEq(const Fraction & op )
{
numerator *= op.numerator;
denominator *= op.denominator;
simplify(); // will make sure that denominator is positive and
// will invoke gcd() function to reduce fraction
// as much as possible
return (*this); // returns the object which invoked the method
}