Abstract Data Type

Project 1 Abstract Data Type(ADT) Bag An ADT Bag is composed of a list of grocery items and a set of operations on the list. You may think of a grocery bag as an instance of the ADT Bag. A grocery bag contains a list of groceries. There is a set of operations that operate on the list. For example, we can add an item, remove an item, count the number of items, check for a specific item, etc. In this project, you will design an ADT bag by following software development cycle including specification, design, implementation, test/debug, and documentation. Specification/Analysis: The ADT Bag must contain the following operations: • create an empty bag that can hold up to 100 items • add an item to the end of the list of this bag- insert(item) • remove the item at the end of this bag – removeLast() • remove an item at a random index from this bag – removeRandom() • get the index of the first occurrence of an item from this bag – get(a reference to an item) • get a reference to an item at position index of this bag(get(index)), • check how many items are there in this bag – size() • check to see if this bag is empty – isEmpty() • empty this bag – makeEmpty()

Requirements: finish the programming

Don't use plagiarized sources. Get Your Custom Essay on
Abstract Data Type
Just from $13/Page
Order Essay

Still struggling to complete your homework?
Get instant homework help from our expert academic writers!