@@ -0,0 +1,2788 @@
+/** A program that formats an invoice based on inputs for item, %0A *  price and quantity.%0A */%0A%0Apackage invoice;%0A%0A/**%0A *%0A * @author k8port%0A */%0Aimport java.util.Scanner;%0Aimport java.text.DecimalFormat;%0A%0Apublic class Invoice %7B%0A%0A    /**%0A     * @param args the command line arguments%0A     */%0A    %0A    public static final double TAX = .0625;%0A    %0A    public static void main(String%5B%5D args) %7B%0A        %0A        // variables%0A        double price1, price2, price3, total1, total2, total3, sales_tax, grand_total;%0A        int quantity1, quantity2, quantity3;%0A        String name1, name2, name3, str1 = %22Item%22, str2 = %22Quantity%22, %0A                        str3 = %22Price%22, str4 = %22Total%22;%0A        Scanner scan;%0A        DecimalFormat dec;%0A        %0A        // gather info%0A        scan = new Scanner(System.in);%0A        // item 1%0A        System.out.println(%22Enter name of item 1:%22);%0A        name1 = scan.nextLine();%0A        System.out.println(%22Enter name of item 2:%22);%0A        name2 = scan.nextLine();%0A        System.out.println(%22Enter name of item 3:%22);%0A        name3 = scan.nextLine();%0A        %0A        System.out.println(%22Enter quantity of item 1:%22);%0A        quantity1 = scan.nextInt();%0A        System.out.println(%22Enter quantity of item 2:%22);%0A        quantity2 = scan.nextInt();%0A        System.out.println(%22Enter quantity of item 3:%22);%0A        quantity3 = scan.nextInt();%0A        %0A        System.out.println(%22Enter price of item 1:%22);%0A        price1 = scan.nextDouble();  %0A        System.out.println(%22Enter price of item 2:%22);%0A        price2 = scan.nextDouble();  %0A        System.out.println(%22Enter price of item 3:%22);%0A        price3 = scan.nextDouble();  %0A        %0A        total1 = price1 * quantity1;%0A        total2 = price2 * quantity2;%0A        total3 = price3 * quantity3;%0A        grand_total = total1 + total2 + total3;%0A%0A%0A        %0A        %0A        System.out.println(%22Your bill:%22);%0A        System.out.println(%22%22);%0A        System.out.printf(%22%25-30s %25-10s %25-10s %25-10s%25n%22, str1, str2, str3, str4);%0A        System.out.printf(%22%25-30s %25-10d %25-10.2f %25-10.2f%25n%22, name1, quantity1, price1, %0A                                total1);%0A        System.out.printf(%22%25-30s %25-10d %25-10.2f %25-10.2f%25n%22, name2, quantity2, price2, %0A                                total2);%0A        System.out.printf(%22%25-30s %25-10d %25-10.2f %25-10.2f%25n%22, name3, quantity3, price3, %0A                                total3);%0A               %0A        sales_tax = TAX * grand_total;%0A        dec = new DecimalFormat(%220.00%25%22);%0A        String percent = dec.format(TAX);%0A        String str5 = %22Subtotal%22;%0A        System.out.printf(%22%25-50s %2510.2f%25n%22, str5, grand_total);%0A        System.out.printf(%22%25-50s %2510.2f%25n%22, percent, sales_tax);%0A        grand_total += sales_tax;%0A        System.out.printf(%22%25-50s %2510.2f%25n%22, str4, grand_total);%0A        %0A    %7D%0A    %0A%7D%0A

Create Invoice.java