
/**
 * A driver that can be used to test the StateTaxes class
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.1
 * @date 9-16-08
 */
//publicly avaialable class
public class StateDriverZ
{
    /**
     * The entry-point of the application
     *
     * @param args   The command-line arguments
     */
    public static void main(String[] args)
    {

       // StateTaxes.salesTax()
       System.out.println("\nsalesTax()");       
       {
          //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.00, 0.01, 0.05,  3.50,  4.12 };
       
          //a loop defined for testing StateTaxes.java explicitly
          for (int i=0; i<values.length; i++)
          {
             double   tax;
             //calls method in State Taxes --
             tax = StateTaxesZ.salesTax(values[i]);
             //formatted output from statetaxes method, and defined array values
             System.out.printf("Actual: %8.4f\tExpected: %8.4f\n", 
                               tax, correct[i]);
             
          }//end for
       }//end block


       // StateTaxes.foodExemption()
       System.out.println("\nfoodExemption()");       
       {
          //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.001, 0.004, 0.02,  1.40,  1.648};
       
          //a loop defined for testing StateTaxes.java explicitly
          for (int i=0; i<values.length; i++)
          {
             double   tax;
             //calls method in State Taxes -- 
             tax = StateTaxesZ.foodExemption(values[i]);
             //formatted output from statetaxes method, and defined array values
             System.out.printf("Actual: %8.4f\tExpected: %8.4f\n", 
                               tax, correct[i]);
             
          }//end for looop
       }//end block




       // StateTaxes.foodTax()
       System.out.println("\nfoodTax()");       
       {
          //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.00,  0.006, 0.03,  2.10,  2.472};
       
          //a loop defined for testing StateTaxes.java explicitly
          for (int i=0; i<values.length; i++)
          {
             double   tax;
             
             //calls method in State Taxes --
             tax = StateTaxesZ.foodTax(values[i]);
             //formatted output from statetaxes 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 StateDriver class
