/* Fraction.java contains the definitions of the Fraction operations, *  as well as any auxillary functions they utilize. * *  Begun by: Charles Hoot, for Hands On Java. *  Adapted from code by: Joel C. Adams, for Hands On C++. *  Completed by: *  Date: ******************************************************************/import ann.easyio.*;public class Fraction extends Object{	//start placing attributes and methods here	/************************************************************	 * greatestCommonDivisor finds the greatest common divisor  *	 * of two integers, using Euclid's (recursive) algorithm.   *	 *                                                          *	 *  Receive: alpha, beta, two integers.                     *	 *  Return: the greatest common divisor of alpha and beta.  *	 ************************************************************/	private static int greatestCommonDivisor(int alpha, int beta)	{		alpha = Math.abs(alpha);  // take absolute values of operands		beta = Math.abs(beta);		if (beta == 0)       // base case			return alpha;		else                 // induction step		{			int remainder = alpha % beta;			return greatestCommonDivisor(beta, remainder);		}	}}
