Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

AT&T LTE 1:07 PM @ 20% KBack cosc241 P1 Set.doc Specifications 1. Implement the set ADT as a MySet class (MySet inherits MyVector. You can

image text in transcribed
image text in transcribed
AT&T LTE 1:07 PM @ 20% KBack cosc241 P1 Set.doc Specifications 1. Implement the set ADT as a MySet class (MySet inherits MyVector. You can modify the fields in MyVector class to be protected instead of private if needed.) with the following ADT description: a Please refer to the website information about sets, or you can search on internet by yourselt. b. set is an unordered collection of distinct (means no duplicates) elements, c.cardinality-returns the number of elements in this set d. clear)-make this set empty e complement(B)-returns a new set = this set-B t contains(element) -check whether this set contains the given element g.insertelement) - add a new element to this set h. intersection(B)-returns a new set = this set B i. is Empty0-check whether this set is empty j.removelelement) remove the given element from this set k. subsetof(B)-check whether this set is a subset of set I. symmetricDifference(B) -returns a new set-(this set- B) U (B-this set) m.union(B)-returns a new set- this set U B n toString0-returns a String representation of this whole set 2 The MySet class should be created in the collection package The MySet class should implement the Cloneable interface. After implementing the MySet class you will test your MySet class. To test the MySet class you will createa Projectl class under the project package. s. In the Projectl class you will do the following: afind out on internet what is the fibonacci number b. create a static method named test and do the following in this method i. create two instances of MySet: oddNumSet and Dashboard Calendar ToDo Notifications Inbox AT&T LTE 1:07 PM @ 20% KBack cosc241 P1 Set.doc Specifications 1. Implement the set ADT as a MySet class (MySet inherits MyVector. You can modify the fields in MyVector class to be protected instead of private if needed.) with the following ADT description: a Please refer to the website information about sets, or you can search on internet by yourselt. b. set is an unordered collection of distinct (means no duplicates) elements, c.cardinality-returns the number of elements in this set d. clear)-make this set empty e complement(B)-returns a new set = this set-B t contains(element) -check whether this set contains the given element g.insertelement) - add a new element to this set h. intersection(B)-returns a new set = this set B i. is Empty0-check whether this set is empty j.removelelement) remove the given element from this set k. subsetof(B)-check whether this set is a subset of set I. symmetricDifference(B) -returns a new set-(this set- B) U (B-this set) m.union(B)-returns a new set- this set U B n toString0-returns a String representation of this whole set 2 The MySet class should be created in the collection package The MySet class should implement the Cloneable interface. After implementing the MySet class you will test your MySet class. To test the MySet class you will createa Projectl class under the project package. s. In the Projectl class you will do the following: afind out on internet what is the fibonacci number b. create a static method named test and do the following in this method i. create two instances of MySet: oddNumSet and Dashboard Calendar ToDo Notifications Inbox

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

1. How did you go about making your selection?

Answered: 1 week ago