Fraction class for implementing fractions in C++