(C++) Consider the following class definition:
class Fraction
{
private:
int numerator;
int denominator;
public:
Fraction(int n = 0, int d = 1) {numerator = n; denominator =d;}
};
and the following main function:
int main()
{
Fraction X, Y, Z;
cout << “Enter two fractions (in the formnumerator/denominator): “;
cin >> X;
cin >> Y;
Z = X + Y;
cout << X << ” + ” << Y << ” = ” << Z<< endl;
Z = X – Y;
cout << X << ” – ” << Y << ” = ” << Z<< endl;
Z = X * Y;
cout << X << ” * ” << Y << ” = ” << Z<< endl;
Z = X
PayPal Gateway not configured
PayPal Gateway not configured