Yiliang

using namespace std; class Rational { protected: int num, dom; public: Rational{num=0; dom=1;}; Rational(int n,int m) {num= n; dom=m;}; ~Rational{}; void Display{cout</* Implementation for the 4 basic operators do not follow question requirements. Return type must be Rational and not void, once this is noted the other implementation details will be adjusted.
 * 1) include

Note: As a programmer, your solution needs to be precise. Understand the requirements (question) and solve it accordingly. any variations will greater affect the rest of the systems.

{ int xdom, xnum; xdom= a.dom*b.dom; xnum= (a.num*b.dom)+(b.num*a.dom); cout << "Sum is " << xnum << "/" << xdom<< endl; };
 * void** add(Rational a, Rational b)

{ int xdom, xnum; xdom= a.dom*b.dom; xnum= abs((a.num*b.dom)-(b.num*a.dom)); cout << "Difference is " << xnum << "/" << xdom<<endl; };
 * void** sub(Rational a, Rational b)

{ int xdom, xnum; xdom= a.dom*b.dom; xnum= a.num*b.num; cout << "product is " << xnum << "/" << xdom<>a; cout<<"enter 1st numerator"<>b; fract1.Set_dom(a); fract1.Set_num(b); cout<<"enter 2nd denominator"<>c; cout<<"enter 2nd numerator"<>d; fract2.Set_dom(c); fract2.Set_num(d); cout<<"tada"<<endl; fract1.Display; fract2.Display; fract3.add(fract1,fract2); fract4.sub(fract1,fract2); fract5.mult(fract1,fract2); fract6.div(fract1,fract2); system("pause"); }