Project Falcon
We have all been there, the irresistible face of a cute kid selling tasty cookies.
They're everywhere...at the store, knocking on the door, in the parking lot...
Your objective is to create a console application that keeps track of the variety of cookie you ordered and the quantity using an Array. You will also keep track of your total number of boxes purchased. You are going to give the program the ability to remove a variety from the list, just remember, this may make the girl scout sad so please be kind!
Order Objectvariety of cookie and numBoxes purchasedDesign Thinking: Why should we being using Constructor Injection as opposed to Field or Setter Injection?
OrderList Classconst orders Array.OrderList should contain the following methods:addOrder(order)getTotalBoxes()removeOrdersByVariety(variety) (Should remove all orders with provided variety)getBoxesByVariety(variety)Design Thinking: Why did we have the OrderList Object choose to create the addOrder method rather than just exposing the Array and allowing external code to call the built in .push() method on it?
Application ClassCurrent Order Variety: Tagalongs Boxes: 1 Variety: Thin Mints Boxes: 5 Variety: Samoas Boxes: 2 Variety: Tagalongs Boxes: 3 You have ordered 11 boxes What would you like to remove? (specify a variety or none) Thin Mints You are removing 5 Thin Mints Current Order Variety: Tagalongs Boxes: 1 Variety: Samoas Boxes: 2 Variety: Tagalongs Boxes: 3
Orders and interact with them individually.