1. Create a class RationalNumber (fractions, see problem 10.8 p.490) with the following capabilities: a) Create a constr
Posted: Fri May 20, 2022 1:29 pm
1. Create a class RationalNumber (fractions, see problem 10.8 p.490) with the following capabilities: a) Create a constructor that prevents 0 on the denominator in a fraction, reduces (or simplifies) fractions that are not in reduced form (lowest terms), and avoids negative denominators b) Overload the addition, subtraction, multiplication, and division operators for this class. c) Overload the relational < and > and equality operators for this class. Test all member functions and overloaded operators.
1. Create the numbers Numerator = 4, Denominator = 14 Numerator = 4, Denominator = 0 Numerator = 4, Denominator =-14 Numerator +-4, Denominator =-14 Numerator - 2, Denominator = 3 Test the constructor, overloded +, -, .7.<,>, <= >=, --, !