Question: 6.What's wrong with the following class definition? Defend your answer. class Fraction; // Forward Declaration // Function Prototypes for Overloaded Stream Operators ostream &operator <

6.What's wrong with the following class definition? Defend your answer. class Fraction; // Forward Declaration // Function Prototypes for Overloaded Stream Operators ostream &operator << (ostream &, const Fraction &); istream &operator >> (istream &, Fraction &); class Fraction{ private: int numerator; int denominator; public: // Constructors // ... // Setters // ... // Getters // ... // Overloaded operator functions Fraction operator+ (const Fraction &); // Overloaded + Fraction operator-(const Fraction &); // Overloaded - Fraction operator++ ();// Prefix ++ Fraction operator++ (int);// Postfix ++ Fraction operator--(); // Prefix -- Fraction operator--(int); // Postfix -- bool operator> (const Fraction &); // Overloaded > bool operator< (const Fraction &); // Overloaded < bool operator== (const Fraction &); // Overloaded == ostream &operator<< (ostream &, const Fraction &); istream &operator>> (istream &, Fraction &); };

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!