
/**
 * A driver that can be used to test the LocalTaxes class
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.1
 * @date 9-16-08
 */
//publicly avaiable class
public class LocalDriverZ
{
    /**
     * The entry-point of the application
     *
     * @param args   The command-line arguments
     */
    public static void main(String[] args)
    {

       // LocalTaxes.preparedFoodSurcharge()
       System.out.println("\npreparedFoodSurcharge()");       
       {
    	  //arrays used for testing output
          double[] values  = {-1.00, 0.00, 0.05,   0.20,  1.00, 70.00, 82.40 };
          double[] correct = { 0.00, 0.00, 0.0035, 0.014, 0.07,  4.90,  5.768 };
       
          //a loop defined for testing LocalTaxes.java explicitly
          for (int i=0; i<values.length; i++)
          {
             double   tax;
             
             //calls method in Local Taxes -- 
             tax = LocalTaxesZ.preparedFoodSurcharge(values[i]);
             //formatted output with localtaxes method, and defined array values
             System.out.printf("Actual: %8.4f\tExpected: %8.4f\n", 
                               tax, correct[i]);
             
          }//end loop
       }//end block


       // LocalTaxes.preparedFoodTax()
       System.out.println("\npreparedFoodTax()");       
       {
          //arrays used for testing output
          double[] values  = {-1.00, 0.00, 0.05,   0.20,  1.00, 70.00, 82.40 };
          double[] correct = { 0.00, 0.00, 0.0035, 0.024, 0.12,  8.40,  9.888};
       
          //a loop defined for testing LocalTaxes.java explicitly
          for (int i=0; i<values.length; i++)
          {
             double   tax;
             
             //calls method in Local Taxes -- 
             tax = LocalTaxesZ.preparedFoodTax(values[i]);
             //formatted output with localtaxes method, and defined array values
             System.out.printf("Actual: %8.4f\tExpected: %8.4f\n", 
                               tax, correct[i]);
             
          }//end for loop
       }//end block
    }//end main
}//end Localdriver class
