
/**
 * Checkout2.java
 *
 *
 * Created: Tue Nov 19 22:28:37 2002
 *
 * @author <a href="mailto:bina@cse.buffalo.edu "</a>
 * @version
 */
import java.text.*;
import java.util.*;
public class Checkout2 {
  public static void main (String[] args) {
      double price1= 4.5, price2= 7.8, price3= 6.5;
      double total;
      double tax;

      NumberFormat nf = 
       NumberFormat.getCurrencyInstance(Locale.US);
    
      TaxRule t = new CanadaTaxRule();// can be replaced by CanadaTaxRule

      
      total = price1 + price2 + price3;

      System.out.println("The total price before tax is: " + 
			 nf.format(total));

      total = ((Double)t.computeTax(new Double(total))).doubleValue();

      System.out.println("The total price after tax is: " + nf.format(total));
      
   } // end of main ()
   
}// Checkout2
