Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab work: This lab is a stepping stone to project 01. The ADT Bag is a group of items, much like what you might have

image text in transcribed
Lab work: This lab is a stepping stone to project 01. The ADT Bag is a group of items, much like what you might have with a bag of groceries. The ADT Bag should have the following operations. You should use the same operation names that are shown below. create an empty bag that can hold up to 50 items, put an item at the end of the list of the bag (insert(item)), remove the last item in the bag (removeLast()). remove a random item from the bag (remove Random()). (Note: a random item is an item at a random index.) get the index of the first occurrence of an item from the bag if it is existed (get(item)), get a reference to an item at position indexl getindex)), check how many items are in the bag (size()), check to see if the bag is full (isFull()). check to see if the bag is empty( isEmpty(). and completely empty the bag (makeEmpty()). To design the ADT Bag, create a UML class diagram and include the designs of the above-mentioned operations except the constructor (the first one). By standard, constructors shouldn't be included in an UML class diagram. Constructors should be included in the classes that implement the design. To translate the design into a computer program, write an interface class(java) or an abstract class(C++). In the interface (Java), you should only include the method headers. In the abstract class(C++), all functions should be pure virtual functions. Save the class diagram and its translation into a folder. Zip the folder, and submit the zipped file on time in Blackboard. One submission per lab

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

Step: 3

blur-text-image

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

Students also viewed these Databases questions

Question

16.4 Outline the five steps in the labour relations process.

Answered: 1 week ago