Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bag ADT Delaware Technical Community College Program Specifications: As we prepare to explore various data structures, it's important to be able to fully understand the

Bag ADT
Delaware Technical Community College
Program Specifications:
As we prepare to explore various data structures, it's important to be able to fully understand the concept of abstraction and apply it to java.
Given a very simple "Bag" abstract data type, look at the given java interface, and implement a concrete ArrayListBag class that provides the functionality using an ArrayList as the storage mechanism.
To Do:
Implement the ArrayListBag according to the intertface
Implement a toString method in the ArrayListBag
Design and implement a test program that creates at minimum:
One bag that contains integers
One bag that contains ALL THE Pokemon from the pokemon CSV file
The bag object should end up with 800 pokemon objects at the end of the program.
Tests removing items, including trying to remove from an empty bag
You'll only be able to test the removeItem on Integers, NOT pokemon. So please make sure you test the remove ONLY with the integer bag.
No user interaction is needed for this program.
Bag Interface:
/*
Starter code for ITN262, Bag ADT Assignment
Delaware Technical Community College
*/
public interface Bag {
/*
@param item the object to be added to the bag
@throws UnsupportedOperationException if the item cannot be added to the bag
*/
public void add(T item) throws UnsupportedOperationException;
/*
@param item the object to be removed from the bag
@return T the object removed from the bag or null if the object is not found in the bag
*/
public T removeItem(T item);
}

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

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions

Question

2 The main characteristics of the market system.

Answered: 1 week ago