|
CSIS 250 Summer 2000 Assignment #3Date Assigned: July 20, 2000 Date Due: July 25, 2000 at 10:00 AM Overload the following operators to the CRational class for performing arithmetic and comparison operations among fractions. More information about fractions can be obtained at the following Web site. http://www.sosmath.com/algebra/fraction/frac3/frac3.html Write a main driver program and several test functions (one for each operator function member). Overload the following operators: a) Addition operator (+) for two CRational numbers. The result should be stored in reduced form. b) Subtraction operator (-) for two CRational numbers. The result should be stored in reduced form. c) Multiplication operator (*) for two CRational numbers. The result should be stored in reduced form. d) Division operator (/) for two CRational numbers. The result should be stored in reduced form. e) Insertion operator (<<) for printing CRational numbers in the form a/b where a is the numerator and b is the denominator f) Extraction operator (>>) for inputting CRational numbers. g) Equality operator (==) for comparing two rational numbers. h) Inequality operator (!=) for comparing two rational numbers. i) Less-than operator (<) for comparing two rational numbers. j) Greater-than operator (>) for comparing two rational numbers. k) Less-than-or-equal-to operator (<=) for comparing two rational numbers. l) Greater-than-or-equal-to operator (>=) for comparing two rational numbers.
Self-Evaluation Sheet Project #3
|