Ryan+Wong

code
 * 1) include

using namespace std;

class Rational{

protected: //accesible only in class int num, den;

public: //accesible anywhere in program

Rational{num=0; den=1;}; //constructor Rational(int n, int m) {num=n; den=m;}; ~Rational{}; //destructor void Display{cout<<num<<"/"<<den;} void Set_num(int n) {num= n;}; void Set_den(int m) {den= m;};

void ADD(Rational temp) //creating add function {         int anum, aden; anum=temp.den*num+temp.num*den; aden=den*temp.den; cout<<"The sum is: "<<anum<<"/"<<aden<<endl; };

void Minus(Rational temp) //creating minus function {         int anum, aden; anum=temp.den*num-temp.num*den; aden=den*temp.den; cout<<"The difference is: "<<anum<<"/"<> x;         cout <<"Enter the first denominator: "<> y;         cout <<"Enter second numerator: "<> j;         cout << "Enter second denominator: "<> k;         fraction1.Set_num(x); fraction1.Set_den(y); fraction2.Set_num(j); fraction2.Set_den(k); fraction1.ADD(fraction2); cout<<endl; fraction1.Minus(fraction2); cout<<endl; fraction1.Multiply(fraction2); cout<<endl; fraction1.Divide(fraction2); cout<<endl;

system("PAUSE");

} code Type in the content of your page here.