/**
 * A driver for testing the UnitConverter class
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 2.0
 */
public class Driver
{
    /**
     * The entry point of the application
     *
     * @param args   The command-line arguments
     */
    public static void main(String[] args)
    {
	double                converted, original;
	int                   i, j;
	String                from, to;
	String[]              units = {"inches","feet","yards","miles"};
	UnitConverter         calculator;


	calculator = new UnitConverter();

	original  = 10.0;
	
	for (i=0; i < units.length; i++) {
	    for (j=0; j < units.length; j++) {

		from      = units[i]; // This could be outside the inner loop
		to        = units[j];
		converted = calculator.convert(original, from, to);
		System.out.println(original+" "+from+" = "+converted+" "+to);
	    }
	}
    }

}
