You need to start thinking more about fractions as whole objects instead of a collection of details.
To that end, your arithmetic operations are such that two Fraction objects are processed and a resultant Fraction object is returned. A slight difference is that you should take the one on the left hand side to be the one that actually does the operation and then creates a third Fraction. Your operations should thus be of the form:
Language: C++
Fraction Fraction::arithmeticOperation(const Fraction &rhs);
This may be a bit too abstract so I'll help you out with the sum function.
Language: C++
Fraction Fraction::sum(const Fraction &rhs){
int newNumerator, newDenominator;
newNumerator = numerator * rhs.denominator + rhs.denominator * denominator;
newDenominator = denominator * rhs.denominator;
return Fraction(newNumerator, newDenominator);
}
To use this you can do the following:
Language: C++
Fraction half (1, 2), quarter(1, 4);
Fraction sixEighths = half.sum(quarter);
Note that the original Fraction objects are not altered in any way and a new Fraction (the sum) is created.
I hope this helps.