Question: 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
Get step-by-step solutions from verified subject matter experts
