Question: rational in c++ programming #ifndef _RATIONAL_H_ #define _RATIONAL_H_ #include using namespace std; class Rational { int_p; int_q; public: Rational(); Rational (int P, int Q =

rational in c++ programming
rational in c++ programming #ifndef _RATIONAL_H_ #define _RATIONAL_H_ #include using namespace std;
class Rational { int_p; int_q; public: Rational(); Rational (int P, int Q
= 1); void display() const; // _p:_9 void add(const Rational&); void sub(const

#ifndef _RATIONAL_H_ #define _RATIONAL_H_ #include using namespace std; class Rational { int_p; int_q; public: Rational(); Rational (int P, int Q = 1); void display() const; // _p:_9 void add(const Rational&); void sub(const Rational&); void mult(const Rational&); #endif In Rational.cpp, implement these member functions. You must make sure that you never have _qs zero[1]. Your Rational number must be stored in reduced form, that is, _p and _q must be relatively prime. You must not use any built-in functions In RationalMain.cpp, write a test main to test your code. Uvivu. UUUJIH, LULU PUU9 must be relatively prime. You must not use any built-in functions In RationalMain.cpp, write a test main to test your code. Submit these four files via the drop-box [1] _q cannot be zero for Rational numbers. We have added an additional constraint that _q must be greater than zero. This does not mean that a _g

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!