/**
 * 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  Jimmy Tessitore
 * @version 1.0  September 9, 2008
 */
    public class LocalTaxes
   {
	//Declaration & instantiation of final static variables
      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)
      {
       //Declaration
         double   surcharge;
       
       //Loop to calculate surcharge if value is non-negative
         if(value > 0)
         {
            surcharge = value * PREPARED_FOOD_SURCHARGE_RATE;
         }
         
         //If value is negative, it returns a default value
         else
         {
            surcharge = 0;
         }
      
       //return surcharge value
         return surcharge;       
      }
    
   
    /**
     * 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)
      {
      //Declarations
         double   tax;
         double   stateTax;
         double   localTax;
       
       //Initializations
       //Default constructor used to call salesTax() method
         StateTaxes myStateTaxes = new StateTaxes();
       //Makes local variables hold the values the two methods calculate
         stateTax = myStateTaxes.salesTax(value);
         localTax = preparedFoodSurcharge(value);
       
       //Calculates the sum of the state sales tax 
       //and local prepared food surcharge
         tax = stateTax + localTax;
      	
			//returns prepared food tax
         return tax;       
      }
    
   }//end LocalTaxes
