Wen+Jun

code using namespace std;
 * 1) include

class Rational { protected: int num, den; public: Rational {num=0;den=1;}; Rational (int n, int d) {num=n; den=d;}; Rational ADD (Rational A)   {Rational f;        f.num=num*A.den+den*A.num; f.den=den*A.den; return f;   } Rational Minus (Rational A)   {Rational f;        f.num=num*A.den-den*A.num; f.den=den*A.den; return f;   } Rational Multiply (Rational A) { Rational F;       F.num=num*A.num; F.den=den*A.den; return F;   } Rational Division (Rational A) { Rational F;       F.num=num*A.den; F.den=den*A.num; return F;   } ~Rational {}; void Display {cout<<num<<"/"<<den<<endl;}; void Set_num(int n) {num=n;}; void Set_den(int d) {den=d;}; };

int main { int n,d; Rational R1; Rational R2; Rational R3; Rational R4; Rational R5; Rational R6; R1.Set_num(2); R1.Set_den(3); R2.Set_num(1); R2.Set_den(4); R1.Display; R2.Display; R3=R1.ADD(R2); R4=R1.Minus(R2); R5=R1.Multiply(R2); R6=R1.Division(R2); R3.Display; R4.Display; R5.Display; R6.Display; system ("pause"); return 0; }

code