From 7a238a93efd755ccc9156d2386c79733bcead402 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Wed, 11 Nov 2020 11:54:52 -0500 Subject: [PATCH] continue --- Week-11-final-start/part-2/ShoppingCart.java | 56 ++++++++++++++----- .../part-2/ShoppingCartManager.java | 22 +++++++- 2 files changed, 63 insertions(+), 15 deletions(-) diff --git a/Week-11-final-start/part-2/ShoppingCart.java b/Week-11-final-start/part-2/ShoppingCart.java index 213616a..9db2101 100644 --- a/Week-11-final-start/part-2/ShoppingCart.java +++ b/Week-11-final-start/part-2/ShoppingCart.java @@ -3,7 +3,7 @@ import java.util.ArrayList; public class ShoppingCart { private String customerName; private String currentDate; - private ArrayList cartItems; + private ArrayList cartItems; ShoppingCart (){ customerName = "none"; @@ -22,12 +22,21 @@ public class ShoppingCart { return currentDate; } + private void printNameDate (){ + System.out.println(customerName + " Shopping Cart - "+ currentDate); + } + public void addItem(ItemToPurchase item){ - //add item to cartItems + cartItems.add(item); } public void removeItem(String itemName){ - //if itemname not found print - //"Item not found in cart. Nothing removed." + for (int i=0; i