/**
 * A utility class that can be used to calculate local taxes.
 *
 * In this case, the only local taxes are on prepared foods.
 *
 *
 * This work complies with the JMU Honor Code.
 *
 * @author  Mark Koskinen
 * @version 1.0, Date: September 15, 2008
 */
public class LocalTaxes
{
    private static double PREPARED_FOOD_SURCHARGE_RATE      = 0.07;


    /**
     * Calculate the surcharge on prepared food
     *
     * @param value   The value of the prepared food
     * @return        The surcharge (in dollars)
     */
    public static double preparedFoodSurcharge(double value)
    {
	 
	 	 //Prepared Food Surcharge: 7% of the (total) value of the prepared food 
		 //being purchased (assuming the value is positive). 
		 
       double   surcharge;
       
       surcharge = 0.0;
		 //multiply the value by the tax rate
		 if (value > 0) surcharge = value * PREPARED_FOOD_SURCHARGE_RATE;

       return surcharge;       
    }
    

    /**
     * Calculate the tax on prepared food
     *
     * @param value   The value of the prepared food
     * @return        The tax (in dollars)
     */
    public static double preparedFoodTax(double value)
    {
	 
	 	 //Prepared Food Tax: The sum of the (state) sales tax 
		 //and the (local) prepared food surcharge.
		 
       double   tax;

       tax = preparedFoodSurcharge(value) + StateTaxes.salesTax(value);

       return tax;       
    }
    
}
