public class Fraction {

   private int numerator; 
   private int denominator;


   // Two argument constructor
   Fraction(int top, int bottom) throws ImproperFractionException {
         if (top >= bottom) throw (new ImproperFractionException(top,bottom));
	 numerator = top;
	 denominator = bottom;
   }

   // Add method 
   public Fraction  add(Fraction other) throws ImproperFractionException {
	   int top, bottom;

	   bottom = denominator * other.denominator;
	   top = numerator*other.denominator + 
			 denominator*other.numerator;

	   Fraction result = new Fraction(top, bottom);
	   return(result);
   }

   public String toString() {
          return(numerator+"/"+denominator);
   }

}
