/***
* FractionDriver.java
* Serves as a tester for the CS239 student-created Fraction class
* 
* @author	Evan Jacobs
* @date		2/12/07 
***/
public class FractionDriver
{
	/***
	* Main method creates three Fraction objects and tests to see if they work
	*
	* @param args	Run arguments that don't matter
	***/
	public static void main(String[] args)
	{
		// Creation of three Fraction objects
		Fraction oneovertwo = new Fraction(1, 2);
		Fraction fouroverthree = new Fraction(4, 3);
		Fraction sixovertwelve = new Fraction(6, 12);
		
		System.out.println("Should display:\nFirst fraction is  1 / 2\n" + 
		 "Second fraction is  4 / 3\nThird fraction is  6 / 12\n");
		System.out.println("First fraction is  " + oneovertwo.toString());
		System.out.println("Second fraction is  " + fouroverthree.toString());
		System.out.println("Third fraction is  " + sixovertwelve.toString());
		
		// Test addition function
		System.out.println("\n\nShould display:\n1 / 2  +  4 / 3  =  11 / 6\n");
		System.out.println(oneovertwo.toString() + "  +  " + fouroverthree.toString() +
		 "  =  " + sixovertwelve.add(oneovertwo, fouroverthree).toString());
		
		// Test multiplication function
		System.out.println("\n\nShould display:\n1 / 2  *  4 / 3  =  2 / 3\n");
		System.out.println(oneovertwo.toString() + "  *  " + fouroverthree.toString() +
		 "  =  " + sixovertwelve.multiply(oneovertwo, fouroverthree).toString());
		
		// Test reduction function
		System.out.println("\n\nShould display:\n6 / 12  reduces to  1 / 2\n");
		System.out.println(sixovertwelve.toString() + "  reduces to  " + 
		 oneovertwo.reduce(sixovertwelve).toString());
		 
		 // Test gcd function
		 System.out.println("\n\nShould display:\nThe GCD of 2 and 3 is  6\n");
		 System.out.println(" The GCD of " + oneovertwo.toString() + " and " +
		  fouroverthree.toString() + " is " + 
		  sixovertwelve.cd(2, 3));
	}
}