CS201 – Spring 2003
Prof. Hartman
Homework #7
Due Wednesday, March 26th
by 12:00 pm
Remember that all programs must follow the guidelines from handout #3.
1)
Update your rational number class to use overloaded
operators. (You’ll need to overload +, - (both unary and binary), *, /, and the
insertion (<<) and extraction (>>) operators.) Use this main() to test
your code. (Notice how much shorter and cleaner the main program is compared to
the one I gave you for homework #6?) Make sure you use const in all the proper places, and use separate
compilation. (That is, you should have separate files rational.h, rational.cpp,
and main7.cpp.)