Reciprocal and Output Functions

Now you will implement the reciprocal and output functions in Fraction.cpp. The reciprocal function should return a new fraction object with the numerator and denominator swapped. For example:

  Fraction frac(1, 2);                  // frac is 1/2
  Fraction newFrac = frac.Reciprocal(); // newFrac is 2/1

Your output function must print the numerator and denominator of the fraction separated by a forward slash. For example:

  Fraction frac(2, 3);
  frac.Output();           // produces the output "2/3"
Consider whether the functions should be const.