Question
I want to know how to translate the design into a computer program write an interface class java and please put on the comments I
I want to know how to translate the design into a computer program write an interface class java and please put on the comments
I would use the eclipse
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 (removeRandom()), (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 index( get(index)), 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 shouldnt 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started