Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

Answer To proceed with transforming your code to utilize inheritance and polymorphism you can start by creating classes for the different entities inv... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managerial Accounting Decision Making and Performance Management

Authors: Ray Proctor

4th edition

273764489, 978-0273764489

More Books

Students also viewed these Programming questions

Question

define a process path

Answered: 1 week ago