Question: Write a program using Java Programming Language. All details are on the photos below. Object-oriented Programming Assignment #4 Deadline: Tuesday, Apr. 3 1. Program to

Write a program using Java Programming Language. All details are on the photos below.

Write a program using Java Programming Language. All details are on the

photos below. Object-oriented Programming Assignment #4 Deadline: Tuesday, Apr. 3 1. Program

Object-oriented Programming Assignment #4 Deadline: Tuesday, Apr. 3 1. Program to be implemented [a set of integers] A program that manages a set of integers 2. Overview (1) Implement the IntSet class set of integers s is a set whose elements are integers. For example. S = {1, 2, 7,-5}, s = 12, o, 4], m Design, write and test a program that deals with a set of integer elements Implement the methods and fields of the following IntSet class public class IntSet // ??? ?? ?? public void add (int element) // Add an element element. public void remove int element) /If the element is in the set, delete it. public void print 0 public int getSize 0 ) public int getElement (int index) / Obtain the index ith element. (Index starts from 0) public boolean isln (int element) I / Returns true if the element is in the set or return false if it is not. public void clear ) // Lists the elements of the set. // Returns the number of the element in the set // Delete all elements and make the set to be an empty set If you properly implement the class above, you can get the execution results of the test program belovw public class SetTester public static void main (Stringl args) IntSet s1new IntSet 0 s1.add (4) s1.add (2): s1.add (-3); System.out.printin ("sizes1.getSize0 / print: size 3 s1.print 0: // ?? : 4. 2.-3 System.out.println (s1.isln (2) ); I/ print: true s1.remove (-3), System.out.println (s1.isln (-3) ) // print: false for (int i = 0: i

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!