/**
 * 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  Hunter McMillen
 * @version 1.0 - 9/8/08
 */
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)
    {
       double   surcharge;
       
       //checks to see if the value is positive
       //ensures you dont get a negative result
       if(value > 0)
       {
          surcharge = value * PREPARED_FOOD_SURCHARGE_RATE;
       }
       else //if negative argument then surcharge is zero
       {
          surcharge = 0;
       }
       
       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;
       
       //checks for a positive argument to 
       //ensure a positive result
       if(value > 0)
       {
          tax = (StateTaxes.salesTax(value) + preparedFoodSurcharge(value));
       }
       else
       {
          tax = 0.0;
       }
       
       return tax;       
    }//preparedFoodTax
}//end LocalTaxes
