HOWARD UNIVERSITY DEPARTMENT OF SYSTEMS AND COMPUTER SCIENCE FALL 2021 Large Scale Programming Due: Friday October 8, by 11:59PM Implement a class, IntegerSet, given the specification below. public...

File, has question


HOWARD UNIVERSITY DEPARTMENT OF SYSTEMS AND COMPUTER SCIENCE FALL 2021 Large Scale Programming Due: Friday October 8, by 11:59PM Implement a class, IntegerSet, given the specification below. public class IntegerSet { // Hint: probably best to use an array list. You will need to do a little research private List set = new ArrayList(); // Default Constructor public Set() { } // Clears the internal representation of the set public void clear() {…}; // Returns the length of the set public int length() {…}; // returns the length /* * Returns true if the 2 sets are equal, false otherwise; * Two sets are equal if they contain all of the same values in ANY order. */ public boolean equals(IntegerSet b) {…}; // Returns true if the set contains the value, otherwise false public boolean contains(int value) {…}; // Returns the largest item in the set; Throws a IntegerSetException if the set is empty public int largest() throws IntegerSetException {…}; // Returns the smallest item in the set; Throws a IntegerSetException if the set is empty public int smallest() throws IntegerSetException; // Adds an item to the set or does nothing it already there public void add(int item) {…}; // adds item to s or does nothing if it is in set // Removes an item from the set or does nothing if not there public void remove(int item) {…}; Throws a IntegerSetException of the set is empty // Set union public void union(IntegerSet intSetb) {…}; // Set intersection public void intersect(IntegerSet intSetb) {…}; // Set difference, i.e., s1 –s2 public void diff(IntegerSet intSetb); // set difference, i.e. s1 - s2 // Returns true if the set is empty, false otherwise boolean isEmpty(); // Return String representation of your set public String toString() {…};// return String representation of your set } Everyone should commit their work to the same repository used for previous assignments. Your package structure should be: org.howard.edu.lsp.assignment3.test (contains your test code, call is Driver.java) org.howard.edu.lsp.assignment3.implementation (contains your IntegerSet class) org.howard.edu.lsp.assignment3.javadocs (contains your generated html documentation from your javadocs in your code) Below is sample of how your driver should look. Your driver contains your main method and its primary function is to test your IntegerSet class. Every method in IntegerSet should be sufficiently tested and your output easy to read. Below is a small example of the granularity of how your output should look. Each operation on a method should show the contents of your IntegerSet before and after each operation. Part of your grade on this assignment is how expressive your output is. … IntegerSet set1 = new IntegerSet(); set1.add(1); set1.add(2); set1.add(3); System.out.println(“Value of Set1 is:” + set1.toString()); System.out.println(“Smallest value in Set1 is:” + set1.smallest()); System.out.println(“Largest value in Set1 is:” + set1.largest()); IntegerSet set2 = new IntegerSet(); set2.add(4); set2.add(5); System.out.println(“Union of Set1 and Set2”); System.out.println(“Value of Set1 is:” + set1.toString()); System.out.println(“Value of Set2 is:” + set2.toString()); set1.union(set2);// union of set1 and set2 System.out.println(“Result of union of Set1 and Set2”); set1.toString();// result of union of set1 and set2 The above format is just a template to use. At the end of the day your output should be an indicator that your program works for ALL methods in IntegerSet. This assignment requires a little research on your own. (1) Figure out how to use an ArrayList as your set implementation and (2) Figure out how to create a throw a user defined exception. Ask questions on Piazza if you have any questions. I will briefly cover these items in the lecture I post for 9/30. Finally, you are required to generate and submit the html documentation from the javdocs in your code. Once again, this will require a little research. For those using eclipse, this can typically be done within the IDE. Here, Google is your best friend. There is no collaboration on this assignment. Questions may be directed to me or Piazza. Although, if someone figures out how to generate html documentation from your javadocs you may share it with the class on Piazza. Below is the breakdown of how you will be evaluated: Program correctness (75 pts.) Documentation (javadocs and generation of html) (25 pts.) Robust test cases (50 pts.) Please start this assignment early!!
Oct 11, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here