Question: Assignment Description: In this assignment you will develop and document a class to represent a Set. You will test your implementation against a battery of

 Assignment Description: In this assignment you will develop and document a
Assignment Description: In this assignment you will develop and document a class to represent a Set. You will test your implementation against a battery of JUnit tests.
Download the associated files from Blackboard. Consult and use these to implement the Set class that implements the functionality described below. Note that no changes should be made to the SetSpec.java or SetElementValueOutOfRange.java. Your implementation can not be a wrapper for an existing library but rather should represent a set using a primitive type.
class to represent a Set. You will test your implementation against a

Assignment Description: In this assignment you will develop and document a class to represent a Set. You will test your implementation against a battery of JUnit tests. Download the associated files from Blackboard. Consult and use these to implement the Set class that implements the functionality described below. Note that no changes should be made to the SetSpec.java or SetElementValueOutOfRange.java. Your implementation can not be a wrapper for an existing library but rather should represent a set using a primitive type. Set, Set(List) - Constructors to initialize an empty set and a set containing a specified list of elements, respectively. addElement(int) - Adds an element to the set. removeElement(int) - Removes an element from the set. isInSet(int) - Checks if a specific value is in the set. empty() - Clears the contents of the set (i.e., removes all elements from the set) boolean isEmpty() - Checks if the set is empty. int size) - Returns the number of elements in the set. List to List - Returns the elements in the set as a List of Integers. complement() - Replaces the contents of the set with its complement. Set union(Set S) - Returns the union of the set with S as a new Set. Set intersection(Set S) - Return the intersection of the set with S as a new Set. Assignment Description: In this assignment you will develop and document a class to represent a Set. You will test your implementation against a battery of JUnit tests. Download the associated files from Blackboard. Consult and use these to implement the Set class that implements the functionality described below. Note that no changes should be made to the SetSpec.java or SetElementValueOutOfRange.java. Your implementation can not be a wrapper for an existing library but rather should represent a set using a primitive type. Set, Set(List) - Constructors to initialize an empty set and a set containing a specified list of elements, respectively. addElement(int) - Adds an element to the set. removeElement(int) - Removes an element from the set. isInSet(int) - Checks if a specific value is in the set. empty() - Clears the contents of the set (i.e., removes all elements from the set) boolean isEmpty() - Checks if the set is empty. int size) - Returns the number of elements in the set. List to List - Returns the elements in the set as a List of Integers. complement() - Replaces the contents of the set with its complement. Set union(Set S) - Returns the union of the set with S as a new Set. Set intersection(Set S) - Return the intersection of the set with S as a new Set

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!