// The start of a class to represent a rational number
// P. Conrad for CISC181, Spring 2006


// @@@ THIS INCLUDE FILE IS NOT IDEMPOTENT.   MAKE IT IDEMPOTENT!

class Rational_C {

 public:
  Rational_C (); // init to 1/1
  Rational_C (int theNum, int theDenom);

  void setNum(int theNum);
  void setDenom(int theDenom);
  
  int getNum() const;
  int getDenom() const;

 private:

  // @@@ Fill in the private data members


  // private member functions 
  
  void reduce(); // put fraction in reduced form (e.g. 2/4 becomes 1/2)
  int gcd(int a, int b) const; // compute greatest common divisor
  
  // Hint on gcd: See http://en.wikipedia.org/wiki/Euclidean_algorithm

};


