/**
 * 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  Glenn Young
 * @version 1.0   Date: September 12, 2008
 */
public class LocalTaxes
{
    //constant set to the local 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;
       
		 //if block that confirms the value of the purchase is a
		 //positive amount and sets the surcharge to zero if not
		 if(value > 0.0)
		     //calculates the surcharge
           surcharge = PREPARED_FOOD_SURCHARGE_RATE * value;
		 else
		     surcharge = 0.0;


       //returns the value assigned to surcharge
       return surcharge;       
    }//end preparedFoodSurcharge()
    

    /**
     * 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;

       //calculates the total tax on prepared foods
       tax = StateTaxes.salesTax(value) + preparedFoodSurcharge(value);
       
       //returns the total tax on prepared foods
       return tax;       
    }//end preparedFoodTax()
    
}//end LocalTaxes
