HELP WITH THIS PROGRAM PLEASE
- Create a class Rational using the UML diagram below.
Rational Numerator: int
Denominator: intRational ( )
Rational (int, int)
~Rational ()
Int: getnumerator ()
Int: getdenominator ()
Setnumerator (int)
Setdenominator (int )
- Implement the following function as a friend function of the rational class
- Print Rational (Rational & )
- Create a main function that instantiates 2 objects (object 1, object2) using the primary constructor and 1 object (object3) using the default constructor.
- Perform the following operations on the objects created:
- Set the numerator of object3 to 34
- Set the denominator of object2 to 89
- Set the numerator of object1 to 5
- Confirm that the operations were successful by displaying the result of the following functions Object1.getnumerator
- Object2.getdenominator
- Object3.getnumerator
Call the Print Rational function to display each rational.



LinkBack URL
About LinkBacks



........