Advertisement
vp0415

lec2.3.2

Oct 12th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. public class InvoiceTest
  2.  {
  3.     public static void main( String args[] )
  4.     {
  5.          Invoice invoice1 = new Invoice( "1234", "Jacket", 3, 26.95 );
  6.        
  7.          System.out.println( "Invoice information:" );
  8.          System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
  9.          System.out.printf( "Description: %s\n", invoice1.getPartDescription() );
  10.          System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
  11.          System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
  12.          System.out.printf( "Invoice amount: %.2f\n", invoice1.getInvoiceAmount() );
  13.        
  14.          Invoice invoice2 = new Invoice("5678" , "Yellow Jacket" , 4 , 28.49);
  15.        
  16.          System.out.println( "\nInvoice information" );
  17.          System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
  18.          System.out.printf( "Description: %s\n", invoice2.getPartDescription() );
  19.          System.out.printf( "Quantity: %s\n", invoice2.getQuantity() );
  20.          System.out.printf( "Price: %s\n", invoice2.getPricePerItem() );
  21.          System.out.printf( "Invoice amount: %s\n", invoice2.getInvoiceAmount() );
  22.     }
  23.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement