/**
 * 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  Jake Carey
 * @version 1.0, September 16, 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)
      {
         double   surcharge;
       
         surcharge = 0.0;
      	
			//This if determines whether the value is positive.  If it
			// is positive, it calculates the surchage, if it is negative
			// it sets the surcharge to 0.
      	if (value > 0)
			{
				surcharge = PREPARED_FOOD_SURCHARGE_RATE * value;
			}//end if
			else if(value <= 0)
			{
				surcharge = 0.0;
			}//end else if
      
         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;
      
         tax = 0.0;
       	
			//This calculates the total prepared food tax by calling the salesTaxes()
			// and preparedFoodSurcharge() methods.
      	tax = StateTaxes.salesTax(value) + LocalTaxes.preparedFoodSurcharge(value);
      
         return tax;       
      }//end preparedFoodTax
   }//end LocalTaxes
