
/**
 * 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  Jeremy Halterman
 * @version 1.1
 * @date 9-16-08
 */
//publicly available class
public class LocalTaxesZ
{
	//predefined variable for use by this class only and kept private so non-changeable
    private static double PREPARED_FOOD_SURCHARGE_RATE      = 0.07;


    /**
     * Calculate the surcharge on prepared food
     *
     * @param value   The value of the prepared food
     * @return surcharge       The surcharge (in dollars)
     */
    public static double preparedFoodSurcharge(double value)
    {
       //variable for holding tax declared and initialized to 0
       double   surcharge;
       surcharge = 0.0;
       		//creates a tax only if item costs
       		if(value>0)
       		{
       			surcharge = PREPARED_FOOD_SURCHARGE_RATE * value;   
       		}
       		//does not charge a tax if item is 0
       		else
       			surcharge = 0.0;
       //returns the total of the hot food item's preparation cost
       return surcharge;       
    }
    

    /**
     * Calculate the tax on prepared food
     *
     * @param value   The value of the prepared food
     * @return prepFoodTax       The tax (in dollars)
     */
    public static double preparedFoodTax(double value)
    {
       //declares and initializes a variable for holding the total tax of hot food
       double   prepFoodtax;
       prepFoodtax = 0.0;
       
       /*uses price of food item and passes it to StateTaxes class for taxes then
        uses local classes method of preparedFoodSurcharge for
        creating actual tax cost*/
       prepFoodtax = StateTaxesZ.salesTax(value) + preparedFoodSurcharge(value);
       
       /*returns cost of hot food -- method called within TaxCalculator class's
        *preparedfoodTax method*/
       return prepFoodtax;       
    }//end preparedFoodTax method
    
}//end LocalTaxes class
