Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. //Rational. H
  2.  
  3. #ifndef RATIONAL_H
  4. #define RATIONAL_H
  5.  
  6. class Rational
  7. {
  8. public:
  9. Rational(int = 0, int = 1); // default constructor
  10. Rational operator+(const Rational &);
  11. Rational operator-(const Rational &);
  12. Rational operator*(const Rational &);
  13. Rational operator/(const Rational &);
  14. bool operator==(const Rational &);
  15. bool operator!=(const Rational &);
  16. bool operator>(const Rational &);
  17. bool operator<(const Rational &);
  18. void printRational(void);
  19. void printRationalAsDouble(void);
  20.  
  21. private:
  22. int numerator;
  23. int denominator;
  24. double convertToDouble();
  25. void reduction(void); // utility function 18
  26. };
  27. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement