CSC 273-Data Structures
Dr. R. M. Siegfried
Assignment #2 - Using a Shopping Bag
Due Friday, September 27, 2019
You are going to set up a small shopping system, where you are going to
implement a "shopping bag" subject to the following specifications:
- Each item that will be placed in the bag needs three pieces of data
included: a descriptive name, an item code (2 letters followed by two numbers),
and price (in US dollars).
- You will implement items as a separate class, where these three
properties are private, and there are mutators and accessors for all three
properties, as well as default, conversion and copy constructors.
- You will use the linked list implementation of a bag, and you can find
the bag's source code here and the
demonstration class here.
- There are 5 operations that you can do:
- You can add an item to the bag (you need to give it a descriptivename, item code and price
- You can remove one item from the bag and show whether there are any others of that item in the bag.
- You can remove all of a type of item from the bag.
- You show that you have the item and there are x of that
item in the bag.
- You can show all the items in the bag.
Make sure your code is well documented. Use the methods that are available
in the Bag class.
[Back to the Assignments Page]