I am using a class called Fraction with this format...

the class is used for a fraction that is entered by a user..Code:class Fraction // the Fraction class has two parts { private: int denom; int numer; public: Fraction(int dm, int nm ) : denom(dm), numer(nm) {} friend istream& operator >>(istream& s, Fraction& d); friend ostream& operator <<(ostream& s, Fraction& d); ....... };

I have to overload comparison operators (<, >, ==, and !=)

and display a message letting the user know what fraction is less than greater than..and so on....

how do i convert the fractions from an int to float???? This is what I have in main....

I'm not sure if I need the following in my class or not???Code:int main() { cout << "\nEnter a fraction, an operator (+, -, *, /), and another fraction: " << "\n (for example: 1/2 * 3/4) "; cin >>fr1; // overloaded the << & >> operators cin >> op; cin >>fr2; . . . . if ( fr1 < fr2 ) { cout << fr1; cout << "is less than "; cout << fr2; cout << endl; } if ( fr1 > fr2 ) { cout << fr1; cout << "is greater than "; cout << fr2; cout << endl; } if ( fr1 == fr2 ) { cout << fr1; cout << "is equal to "; cout << fr2; cout << endl; } if ( fr1 != fr2 ) { cout << fr1; cout << "is not equal to "; cout << fr2; cout << endl; }

If anyone can help me that would be great....If you need more info please let me know.....thanksCode:operator float() const { float value = numer / denom; return value; }