Catch-Up Day, Taken

Tom Kelliher, CS23

Mar. 1, 1996

Design a Rational Class

A rational number is the ratio of two integers

Design a rational class with the following operations:

All rationals should be stored in reduced form, using a private method to reduce to lowest terms.

The constructor should take zero, one, or two arguments (initialize to 0, an integer, or a rational, respectively). Again, use default arguments.

Use a Rational Class

Write a small driver program to use the rational class. The source and header files will be provided for you.

Thomas P. Kelliher
Thu Feb 29 16:11:00 EST 1996
Tom Kelliher