Final part 1 done

This commit is contained in:
Logen Kain 2020-11-11 09:43:59 -05:00
parent 3125f9642e
commit 706d225e78

View File

@ -44,12 +44,21 @@ public class ShoppingCartPrinter {
System.out.println("Item 1");
System.out.println("Enter the item name:");
item1.setName(scnr.nextLine());
System.out.println("Enter the item price:");
item1.setPrice(scnr.nextInt());
System.out.println("Enter the item quantity:");
item1.setQuantity(scnr.nextInt());
scnr.nextLine();
System.out.println("Item 2");
System.out.println("\nItem 2");
System.out.println("Enter the item name:");
item2.setName(scnr.nextLine());
System.out.println("Enter the item price:");
item2.setPrice(scnr.nextInt());
System.out.println("Enter the item quantity:");
item2.setQuantity(scnr.nextInt());
System.out.println("TOTAL COST");
System.out.println("\nTOTAL COST");
System.out.println(item1.getName() + " " + item1.getQuantity() +
" @ $" + item1.getPrice() + " = $" +
(item1.getPrice() * item1.getQuantity()));
@ -59,12 +68,7 @@ public class ShoppingCartPrinter {
(item2.getPrice() * item2.getQuantity()));
System.out.println("\nTotal: $" +
((item2.getPrice() * item2.getQuantity()) +
(item1.getPrice() * item2.getQuantity())));
scnr.close();
(item1.getPrice() * item1.getQuantity())));
}
}