Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a class RationalNumbers(fractions) with the followingcapabilities: a) Cre

ID: 3616930 • Letter: C

Question

Create a class RationalNumbers(fractions) with the followingcapabilities: a) Create a constructor that prevents a 0 denominator in afraction, reduces or simplifies fractions that are not in reducedform and avoids negative denominators. b) Overload the addition, subtraction, multiplication,and division operators for this class c) Overload the relational and equality operators forthis class Create a class RationalNumbers(fractions) with the followingcapabilities: a) Create a constructor that prevents a 0 denominator in afraction, reduces or simplifies fractions that are not in reducedform and avoids negative denominators. b) Overload the addition, subtraction, multiplication,and division operators for this class c) Overload the relational and equality operators forthis class

Explanation / Answer

please rate - thanks This should get you started #include #include #include #include class Rational {public: void Inputc(); void Outputc(); Rational operator+(Rational x); Rational operator-(Rational x); Rational operator*(Rational x); Rational operator/(Rational x); int Rational:: gcd(Rational x); void Rational::reduce(Rational& x); private: int num,den; }; Rational Rational::operator + (Rational x) {Rational temp; temp.num=num+x.num; temp.den=x.den; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote