You were asked to create a class that represents a rational number class
You can download a solution, including some tests.
Some things to think about:
Rational a; a.setDenominator(0); a.asDouble();
operator=
return a Rational&
rather
than Rational
or const Rational&
?operator-
and operator+
return a Rational
?operator<<
a friend (rather than a normal member)
?