/**
 * Converts from one unit to another (e.g., inches to feet)
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 0.2   (Implemented convert)
 */
public class UnitConverter
{

    /**
     * Default Constructor
     */
    public UnitConverter()
    {

    }


    /**
     * Perform a conversion
     *
     * @param value    The number to convert
     * @param from     The units for value (e.g., "inches")
     * @param to       The units to convert to (e.g., "feet")
     * @return         The converted value
     */
    public double convert(double value, String from, String to)
    {
	double     result;

	result = value * getMultiplier(from, to);
	return result;
    }



    /**
     * Get the multiplier needed for a conversion
     *
     * @param from     The units to convert from (e.g., "inches")
     * @param to       The units to convert to (e.g., "feet")
     * @return         What "from" needs to be multiplied by to get "to"
     */
    public double getMultiplier(String from, String to)
    {

	return 1.0 / 12.0;
    }

}
