Define the class Rational with the following data members: numerator, denominator (of type integer). The class also
Fantastic news! We've Found the answer you've been seeking!
Question:
Define the class Rational with the following data members: numerator, denominator (of type integer). The class also has the member functions set( ), get( ), and a default parameterized constructor. Overload: 1. *, ==, post-increment rational number operations as members of the class Rational 2. +, pre-increment rational number operations, the insertion operator and the extraction operator as nonmember functions of the class Rational. Use the following rules.
// Rational.cpp
#include \"Rational.h\"
int main() { Rational rOne, rTwo; Rational rSum, rMul;
cin >> rOne >> rTwo;
cout cout
rSum = rOne + rTwo; cout
rMul = rOne * rTwo; cout
cout
cout
if(rOne == rTwo) cout else cout
return 0; }
Posted Date: