InvoicePrinter.java.html

  1  /**
  2     This program demonstrates the invoice classes by printing
  3     a sample invoice.
  4  */
  5  public class InvoicePrinter
  6  {  
  7     public static void main(String[] args)
  8     {  
  9        Address samsAddress 
 10              = new Address("Sam's Small Appliances",
 11                 "100 Main Street", "Anytown", "CA", "98765");
 12  
 13        Invoice samsInvoice = new Invoice(samsAddress);
 14        samsInvoice.add(new Product("Toaster", 29.95), 3);
 15        samsInvoice.add(new Product("Hair dryer", 24.95), 1);
 16        samsInvoice.add(new Product("Car vacuum", 19.99), 2);
 17  
 18        System.out.println(samsInvoice.format());           
 19     }
 20  }
 21  
 22  
 23