rat.h
file must be included
here as well as in the .cpp file. That is because the identifiers
are used here and the compiler must know their definition.
Rational x(-2,6), y(-14,-16), z, w(4);
The object   x   will hold the fraction -1/3 in memory after the
constructor calls reduce to reduce it to lowest terms. The object
  y   will hold 7/8. The object   z   will hold 0/1,
using both default values in the constructor. The object   w  
will be 4/1, using only the second default value of one for the denominator.
x.printRational(); cout << " + "; y.printRational();
z = x.add(y);
cout << " = "; z.printRational(); cout << endl;
z.printRational();
cout << " = "; z.printRationalAsFloat(); cout << endl << endl;
The dot operator is used in an identical way in C++.