/**
 * 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 Micheal Cottingham
 * @version 1.0 - 09/18/08
 */
public class LocalTaxes
{
   // This constant avoids magic numbers
   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;

       // Verify that the value is not less than 0
       if(value <= 0)
		 {
		    // If it is less than 0
			 // we accrue no charges
		    surcharge = 0.0;
		 }

       else
		 {
		    // If it is greater than 0
			 // we take the surcharge in to account
          surcharge = value * PREPARED_FOOD_SURCHARGE_RATE;
		 }

       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;

       // Because the local prepard food tax
		 // uses the state taxes, we create a new object
       StateTaxes st = new StateTaxes();

       // The tax is the sales tax plus the surcharge
		 // we calculated above
       tax = st.salesTax(value) + preparedFoodSurcharge(value);

       return tax;       
    } // end preparedFoodTax
} // end class