Question: Build Store manager class in java. StoreManager is the brain of the system. It contains all the functionality for managing the Inventory, ShoppingCarts, and providing
Build Store manager class in java. StoreManager is the brain of the system. It contains all the functionality for managing the Inventory, ShoppingCarts, and providing information to the StoreView class. StoreManager manages a single Inventory and it will have a variety of methods two for now- to interact with this Inventory object. A StoreManager object should: - Create a new Inventory object upon object creation (i.e., when a StoreManager object is created). - Have functionality to check how much stock of a given Product is in the Inventory. - Have functionality to process a transaction given an Array of Product information. For example, imagine that the content of a users shopping cart is as follows: [[productID1, quantity], [productID2, quantity], [productID3, quantity]]. Given each productID, your method should: o Check that the desired quantity exists in the Inventory and return the total for all of the Products. o If there is insufficient quantity of any of the products, your method should return some indication of this failure. It could be, for example -1. o Remember to subtract the quantities from the Inventory stock if the transaction is successful
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
