Assignment:Design a fraction class.

A fraction is a number made up of a numerator and a denominator. Design a class to implement this.

Obviously we’d like to be able to use the normal operators for mathematical operations (+,-,*, /), comparison operations(==, !=, and <), incrementation, decrementation, input and output.

We don’t need to worry about reducing the fraction. In other words, 4/2 is fine, there’s no need to runt hat into 2/1.

Incrementation and decrementation should add or subtract (as appropriate) 1/1 to the object. Input is in the form of “num denom”. Output is in the form “num/denom”

I keep getting an error: error C2064: term does not evaluate to a function taking 2 arguments.Code:#include <iostream> #include <string> using namespace std; class fraction { private: int numerator; int denominator; public: int getNum() {return numerator;} int getDenom() {return denominator;} fraction(); fraction(int,int); //fraction(int num = 1, int denom = 1):numerator(num), denominator(denom) {} fraction operator+(fraction); fraction operator-(fraction); fraction operator*(fraction); fraction operator/(fraction); fraction& operator++(); fraction& operator--(); bool operator==(fraction); bool operator!=(fraction); bool operator<(fraction); friend ostream& operator<<(ostream &out, const fraction& value); friend istream& operator>>(istream &in, fraction& value); string print(); }; fraction::fraction(int num, int denom){ numerator = num; denominator = denom; } fraction fraction::operator+(fraction Frac){ if(numerator == 0 || Frac.getNum() == 0){ if (numerator != 0){ return fraction(numerator,denominator); } else{ return fraction(Frac.getNum(),Frac.getDenom()); } } else{ return fraction((numerator*Frac.getDenom()) + (denominator*Frac.getNum()), denominator*Frac.getDenom()); } } fraction fraction::operator-(fraction Frac){ if(numerator == 0 || Frac.getNum() == 0){ if (numerator != 0){ return fraction(numerator,denominator); } else{ return fraction(Frac.getNum(),Frac.getDenom()); } } else{ return fraction((numerator*Frac.getDenom()) - (denominator*Frac.getNum()), denominator*Frac.getDenom()); } } fraction fraction::operator*(fraction Frac){ return fraction((Frac.getNum()*numerator), (Frac.getDenom()*denominator)); } fraction fraction::operator/(fraction Frac){ return fraction((Frac.getNum()*denominator), (Frac.getDenom()*numerator)); } bool fraction::operator==(fraction Frac){ return((Frac.getNum() == numerator) && (Frac.getDenom() == denominator)); } bool fraction::operator!=(fraction Frac){ return((Frac.getNum() != numerator) || (Frac.getDenom() != denominator)); } bool fraction::operator<(fraction Frac){ double first, second; if(denominator != 0){ first = numerator/ (double) denominator; } else{ first = 0.0; } if(Frac.getDenom() != 0){ second = Frac.getNum()/ (double) Frac.getDenom(); } else{ second = 0.0; } return(first < second); } fraction& fraction::operator++(){ if(denominator != 0){ numerator += denominator; return *this; } else{ cout<< "Enter a proper fraction!"; } } fraction& fraction::operator--(){ if(denominator != 0){ numerator -= denominator; return *this; } else{ cout<< "Enter a proper fraction!"; } } ostream &operator<<(ostream& out, const fraction& value){ out<< value.numerator<<"/"<<value.denominator; return out; } istream& operator>>(istream &in, fraction& value){ int num, denom; in>>num>>denom; value = fraction(num, denom); return in; } int main(){ int Num2, Denom2; fraction f1,f2; cout<< "Enter the first numerator: "; cin>> Num2; cout<< "Enter the first denominator: "; cin>> Denom2; f1(Num2,Denom2); cout<<"The first fraction is: "<<f1.print()<<endl; cout<< "Enter the second numerator: "; cin>> Num2; cout<< "Enter the second denominator: "; cin>> Denom2; f2(Num2,Denom2); cout<<"The second fraction is: "<<f1.print()<<endl; cout<<"The following operations were performed:"<<endl; fraction f3 = f1 + f2; cout<<"Addition: "<<f1.print() << " + " << f2.print() << " = " << f3.print()<<endl; f3 = f1 - f2; cout<<"Subtraction: "<<f1.print() << " - " << f2.print() << " = " << f3.print()<<endl; f3 = f1 * f2; cout<<"Multiplication: "<<f1.print() << " * " << f2.print() << " = " << f3.print()<<endl; f3 = f1 / f2; cout<<"Division: "<<f1.print() << " ÷ " << f2.print() << " = " << f3.print()<<endl; ++f1; cout<<"Incrementation: "<<f1.print() << " ++ " << " = " << f1.print()<<endl; --f2; cout<<"Decrementation: "<<f2.print() << " -- " << " = " << f2.print()<<endl; }

This is in reference to line 158 and 166

Any ideas on what I'm doing wrong? Does the code make sense in general?