Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create one base class for item and two derived classes for any two grocery item. In the base class item, create variables name, price &
Create one base class for item and two derived classes for any two grocery item. In the base class item, create variables name, price & Quantity and also create a default constructor and a parameterized constructor. Now create a virtual function that is invoked by + operator when called increases the quantity of item by 1. Create a pure virtual function too in base class for displaying name and details of item.
Need in c++
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