Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are going grocery shopping. I have start files for you. See UML diagrams below. I have completed the blueprint for the Inventory of items
You are going grocery shopping. I have start files for you. See UML diagrams below. I have completed the blueprint for the Inventory of items in our store. We know their name and the cost each. You need to create a blueprint for the CartItem for the items in your cart. This blueprint has an added field of how many of the items that you wish to purchase. You need to complete the driver ShopArray. I have added methods for loading and printing the inventory. You need to complete main and the other methods below. We want to give the user the following choices in a loop until they choose from the menu.
Choices:
:add to cart :delete from cart :total cart value :display cart :end
import java.util.ArrayList;
public class ShopArray
public static void mainString args
list of all items available
Inventory inventory loadInventory;
your cart
CartItem items new CartItem;
printInventoryinventory;
System.out.printlnChoices:
:add to cart :delete from cart :total cart value
:display cart :end";
public static Inventory loadInventory
Inventory inv new Inventory;
inv new Inventoryoranges;
inv new Inventorybananas;
inv new Inventorypeppers;
inv new Inventoryburritos;
inv new Inventorytacos;
inv new Inventorywhole chicken", ;
invnew InventoryCheerios;
return inv;
public static void printInventoryInventory inv
System.out.printlnItems:;
for int i;i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started