This assignment will help you get practice with: Abstract Data Types Inheritance…
- User
This assignment will help you get practice with:
Abstract Data Types Inheritance Polymorphism C++ pointers C++ Classes C++ virtual and pure virtual functions C++ Class Templates C++ Arrays Task:
A container class is a data type that is capable of holding a collection of items and provides functions to access them. Bag is an example of a container class. It is an unordered collection of items that may have duplicates. In this assignment, you are asked to design and develop an abstract Bag class, called BagInterface, with the following fixed collection of operations: Insert an item of any type into a bag(use void insert and I don't need the frequency) Query the bag contents: two queries Is an item in the bag? How many copies of an item is in the bag? Remove an item from the bag clear the bag Get the size of the bag How many items are there in the bag? Check if the bag is empty Check if the bag is full Assume the bag capacity is 20 In addition to BagInterface, you are asked to implement two classes of bag implementations: PlainBag and MagicChangeBag.
PlainBag is a simple container that holds items of any type using an array implementation.
MagicChangeBag is also very similar to PlainBag, with two exceptions. When an item is inserted into a magic change bag, it’ll magically disappear, and bag looks empty. Whenever a remove operation is invoked, all the items, except the one is removed will appear. answer in 3 files. BagInterface.h PlainBag.h and PlaingBag.cpp MagicChangeBag.h and MagicChangeBag.cpp
- Assistant
- User
can you add more comment in the code
- Assistant
- User
- Assistant
Memo
To: Sarah From: [Your Name] Date: Subject: Addressing the Conflict with John
Dear Sarah,
I have conducted some