Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem Description: When shopping online, you select items and add them to a shopping cart. Duplicate items are permitted in a shopping cart, as you
Problem Description: When shopping online, you select items and add them to a shopping cart. Duplicate items are permitted in a shopping cart, as you can purchase multiples of the same item. You also can remove an item from a shopping cart, if vou change your mind about buying it. The shopping cart can show its current contents with their prices and the total cost of these items. Design the ADT item and shopping cart Requirements Shopping cart Design the shopping cart as a derived class from the Bag class o o Declare total price as a data member o Define a default constructor o Define a member function to get the total price Override the base class methods: add and remove o Itenm Declare three data members: name of item, unit price of item, and quantity of tem Define a default constructor Define a constructor that initializes all three data members by the parameters Define set and get functions for each data member. Define the following operators: Equal to: == Input: >> Output:
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