Question: I am needing to transform my code to have multiple classes utilizing inheritance & polymorphism but a little stuck on how to proceed: - Deleting



I am needing to transform my code to have multiple classes utilizing inheritance & polymorphism but a little stuck on how to proceed:

- Deleting user manually entering in the items (transforming case 1 of inventory manager to viewing inventory) - Hard coded: item, description, price, quantity ie banana, yellow, $2.00, 40


Example:


banana {

// price

// description

// cost

// quantity


}


Further detail: Item extends Banana (


}


Shopping Cart extends or implements Item {


}




I still need the ability to add/remove/purchase items with it showing the details of purchase


Current code:

https://wtools.io/paste-code/bA4q


The actual items that I will be utilizing has nothing to do with food items, and will be re-oriented since I will be needing 5 items to choose from so this will not be copy and pasted as a solution Requested information with multiple classes:

  • Initialization of the Store inventory (should be invoked when the Store Front starts up).
  1. Removing a Salable Product from Store inventory (should be invoked when a Salable Product is purchased).
  2. Adding a Salable Product to Store inventory (should be invoked when a Salable Product purchase is canceled).
  3. Return the entire inventory.
  4. Integration of this class with the Store Front application.
  • Initialization of the Shopping Cart (should be invoked when the Store Front starts up).
  1. Adding a Salable Product to the Shopping Cart (should be invoked when a Salable Product is purchased).
  2. Removing a Salable Product from the Shopping Cart (should be invoked when a Salable Product purchase is canceled).
  3. Return the contents of the Shopping Cart.
  4. Empty the contents of the Shopping Cart.
  5. Integration w/ Store Front App

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer To proceed with transforming your code to utilize inheritance and polymorphism you can start by creating classes for the different entities inv... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!