Question: Problem Description (to be solved in C++): When shopping online, you select items and add them to a shopping cart. Duplicate items are permitted in

Problem Description (to be solved in C++): 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 you 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 o Design the shopping cart as a derived class from the Bag class o Declare total price as a data member o Define a default constructor o Define a member function to get the total price o Override the base class methods: add and remove

Item Declare three data members: name of item, unit price of item, quantity of item 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: <<

Write and document the class in header and implementation files, and compile it separately from the client program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!