Question: Implement the functions for set operations and the CharSet class using Java Programming Language (2) Implement the functions for set operations Implement the basic operations

Implement the functions for set operations and the CharSet class using Java Programming Language

Implement the functions for set operations and the CharSet class using Java

(2) Implement the functions for set operations Implement the basic operations of a set: union (), intersection (n), difference(-), subset. public class SetTesterf public static IntSet union (IntSet s1, IntSet s2) () public static IntSet intersection (IntSet s1, IntSet s2) ( h public static IntSet difference (IntSet s1, IntSet s2) ) public static boolean isSubSet (IntSet subset, IntSet superset) () public static void main (Stringl args) IntSet s1new IntSet ( IntSet s2 new IntSet 0: s1.add (4); s1.add (2) s1.add (-3); I/ s1 4,2, -3 ; s2.add (2); s2.add (-5); // s2 2,-5 ; IntSet s3, s4, s5; s3union (s1, s2); s3.print 0: //print: 4, 2, -3, -5 s4-intersection (s1, s2); s4.print 0 //print: 2 s5 difference (s1, s2); s5.print0 // print: 4, -3 System.out.println ( isSubSet (s4, s1)); // print: true System.out.println isSubSet (s5, s2) ); // print: false (3) Implement the CharSet class A set of characters s is a set whose elements are characters. Ex. S = {'a, 'b','c','d'), S = {'c','d', 'f'), Referring to the IntSet class, design, write and test a program that handles a set of characters Implement the methods and fields of the CharSet class and write its test program. 3, Evaluation Criteria (1) Program Description (2) Execution of the program 4. Submission of the followings: (1) Source Code (2) Program Description (3) Screenshot of the Results

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!