Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am supposed to do the following in Java: Introduction In mathematics, a set is a group of distinct items. Design and implement (using an

I am supposed to do the following in Java:

image text in transcribed

image text in transcribed

Introduction In mathematics, a set is a group of distinct items. Design and implement (using an array) an ADT Set that supports the following operations: 1) +createSet() /I create an empty set 2) tisEmpty(): boolean (query) // determine whether a set is empty 3) +size(): integer fquery) //i.e., its cardinality 4) +add(in item: integer) // returns the number of elements in this set // adds the specified element to this set if it is not already //present 5) +contains (in item : integer): Boolean (query) //determines if this set contains the specified item 6) tunion (in other: Set) : Set // creates a new set containing all of the elements of this set and the other // set (no duplicates) and returns the resulting set 7) tintersection ( in other: Set): Set // creates a new set of elements that appear in both this set and the other set and returns the resulting set 8) Remove all of the items in the set // removes all the items in the set Implementation Details 1) Create an interface named Setlnterface including all eight methods. 2) Create a class named Set to implement the above interface. 3) Create a test class named test to verify your interfae ad class Set's correctness

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

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions

Question

What are the guidelines for determining and using affirmations?

Answered: 1 week ago