Java Project

Java project 

Outcomes: 

• Implement an ADT (specifically a resizable array-based implementation of the Set ADT) 

• Test a class 

Naming requirements (not following any of these may result in a score of 0): 

● The Eclipse project name must be Project2

● You will have write exactly two source code files: ResizableArraySet.java and SetTester.java 

● You will also need to include the Set interface as specified in SetInterface.java. Do not modify this file. Your resizable array set must implement this interface. 

● You will use the default package (this means there should be no package statements in any of your files). 

Your assignment is to: 

1. In a class named ResizableArraySet, implement the abstract data type Set by implementing all of the methods in the interface found in SetInterface.java. Your implementation will use a resizable array of int values that doubles in size any time an item is added when the array is already full. Do not use Java’s ArrayList. You should simply work with an array, and handle the array resizing on your own. 

2. The only instance variables should be the array of int values and a counter for the number of entries in the set. 

3. There should be two constructors: a. A constructor with no parameters. By default this should use an array instance variable with a starting size of 10. 

b. A constructor with an int parameter specifying the starting size of the array instance variable. 

4. SetTester should thoroughly test the methods and constructors in the ResizableArraySet class. It should utilize the main() method and helper methods to print to the screen what is being tested, what results are expected, and then show the actual results. This should not involve any interaction from the user. Do not ask the user to enter input. Just run test cases. Output should look something like this: 

Creating an empty set and adding three items 4 9 2 

Expecting to see 4 9 2 

Result 4 9 2 

Removing 4 and expecting to see 9 2 

Result 9 2 

Your test code should not require me to look at your source code. I should know, by running your tester, what is being tested, what results are expected, and what the actual results are. I will be looking for: 

● Thoroughness (test all constructors and methods) 

● Organization (keep related tests together) 

● Readability (use single blank lines in appropriate places to break your code into “chunks” so it’s easy to know when one part of your testing is done and the next part begins). The Arrays.toString() is a useful way to display the contents of an array. Feel free to use it to output your results.