Question: For this programming assignment you will be implemented a RationalNumber class. In mathematics, a rational number is a number that can be represented as a

 For this programming assignment you will be implemented a RationalNumber class.
In mathematics, a rational number is a number that can be represented
as a fraction, where both the numerator and the denominator in the
fraction are integers (Le., whole numbers). Every integer is a rational number,
because the denominator in the fraction can be 1 (i.e, 7 can
be represented as 7/1) Some (but not all floating pointer numbers (e,
real numbers) are rational numbers as well. The floating point number 2.5

For this programming assignment you will be implemented a RationalNumber class. In mathematics, a rational number is a number that can be represented as a fraction, where both the numerator and the denominator in the fraction are integers (Le., whole numbers). Every integer is a rational number, because the denominator in the fraction can be 1 (i.e, 7 can be represented as 7/1) Some (but not all floating pointer numbers (e, real numbers) are rational numbers as well. The floating point number 2.5 is also a rational number, because it can be represented as the fraction 5/2. Create a class RationalNumberffractions) with these capabilities: a. Implement a constructor that receives two integer parameters (the first is the numerator, and the second is the denominator) that prevents a 0 denominator in a fraction, reduces or simplifies fractions that are not in reduced form and avoids negative denominators b. Implement a printRational member function that prints out a RationalNumber object. c. Overload the addition (+), subtraction (-), multiplication(),division (U/) operators, and assignment () operators for this class d. Overload the relational and equality (, ,,, and l-) operators for this class Sample run 1 (using the app prog1 application program): Rationa1Number c( 7, 3, d 3, 9), x; /3 1/3 2 7/3 1/3 7/9 7/3 is: > 1/3 according to the overloaded operator >-1/3 according to the overloaded 1/3 according to the overloadedoperator 1/3 according to the overloadedoperator 1/3 according to the overloadedoperator

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!