/**
 * 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  Yang Yang
 * @version 1.0 	Sep,11th,2008
 */
public class LocalTaxes extends StateTaxes
{
	//Hold the prepared food surcharge rate
    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)
    {
       double   surcharge;//Hold the surcharge
       
       //Calculate the prepared food surcharge
		if(value < 0)
			surcharge = 0.0;
		else
			surcharge = value * PREPARED_FOOD_SURCHARGE_RATE;

		return surcharge;//Return surcharge

	}//End preparedeFoodSurcharge method

	/**
	 * 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)
    {
       double   tax;//Hold the tax
       
       //Calculate the tax
       if(value <= 0.2)
    	   tax = preparedFoodSurcharge(value);  	   
       else
    	   tax = salesTax(value) + preparedFoodSurcharge(value);
       
       return tax;//Return tax       
    
    }//End preparedFoodTax method
    
}//End LocalTaxes Class
