Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

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

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions