### fractionType Class

My assignment is: Design a class fractionType that performs the arithmetic and
relational operations on fractions. Overload the arithmetic and relational
operators so that the appropriate symbols can be used to perform the
operation. Also, overload the stream insertion and stream extraction operators
for easy input and output.

I want to know if my function definition for operator+ and operator- are okay before I continue on. Also how would I define my operator() function if it is even needed at all?

 ``12345678910111213141516171819202122232425262728`` ``````#ifndef fractionType_h #define fractionType_h #include using namespace std; class fractionType { friend ostream& operator<<(ostream&, const fractionType&); friend istream& operator>>(istream&, fractionType&); private: int numerator, denominator; public: void setFraction(const int& num, const int& den); int getNum() const; int getDen() const; fractionType(int num = 0, int den = 1); fractionType operator+(const fractionType& otherFraction) const; fractionType operator-(const fractionType& otherFraction) const; fractionType operator*(const fractionType& otherFraction) const; fractionType operator/(const fractionType& otherFraction) const; fractionType operator()(const fractionType& otherFraction) const; }; #endif ``````
 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980`` ``````#include #include "fractionType.h" using namespace std; ostream& operator<<(ostream& osObject, const fractionType& fraction) { } istream& operator>>(istream& isObject, fractionType& fraction) { } void fractionType::setFraction(const int& num, const int& den) { numerator = num; denominator = den; if (den == 0) cout << "Denominator cannot be 0!"; } int fractionType::getNum() const { return numerator; } int fractionType::getDen() const { return denominator; } fractionType::fractionType(int num, int den) { numerator = num; denominator = den; } fractionType fractionType::operator+(const fractionType& otherFraction) const { fractionType temp; if (denominator == otherFraction.denominator) { temp.numerator = numerator + otherFraction.numerator; temp.denominator = denominator; } else { temp.numerator = numerator * otherFraction.numerator * denominator; temp.denominator = denominator * otherFraction.denominator; } return temp; } fractionType fractionType::operator-(const fractionType& otherFraction) const { fractionType temp; if (denominator == otherFraction.denominator) { temp.numerator = numerator - otherFraction.numerator; temp.denominator = denominator; } else { temp.numerator = numerator * otherFraction.numerator * denominator; temp.denominator = denominator * otherFraction.denominator; } return temp; } fractionType fractionType::operator*(const fractionType& otherFraction) const { } fractionType fractionType::operator/(const fractionType& otherFraction) const { } fractionType fractionType::operator()(const fractionType& otherFraction) const { }``````