public class Sim2main{
/* USES Class   SetOfInts:
 The menu of  SetOfInts is:
  public boolean isMember(int element)
  public void    addElement(int element)
  public void    deleteElement(int element)
  public void    union( SetOfInts A)
  public void    intersect( SetOfInts A)
  public void    print()
  public int     getElement(int i)
  public int     setElement(int i, int element)
  public int     getsize()

  public void setsize()
  public int findElement(int element)
  public  void insert(int element)
  public void deleteAtIndex(int index)

  public  SetOfInts(int capacity)
******/

  public static void main(String[] args){

     SetOfInts A = new SetOfInts(15);
    A.addElement(6);    A.addElement(2);    A.addElement(4);
    System.out.print("elements of A: "); A.print();

     SetOfInts B = new SetOfInts(5);
    B.addElement(16);    B.addElement(4);    B.addElement(2);
    System.out.print("elements of B:  "); B.print();

     SetOfInts C = new SetOfInts(5);
    C.addElement(16);    C.addElement(4);    C.addElement(12);
    System.out.print("elements of C:  "); C.print();


    A.union(B); 
    System.out.print("elements of A union with B: "); A.print();

    B.intersect(C); 
    System.out.print("elements of B intersect with C:  "); B.print();

    System.out.print("elements of C:  "); C.print();

    A.deleteElement(100); A.deleteElement(4);
    System.out.print("elements of A: "); A.print();
  }
}

/* THE OUTPUT IS:
elements of A: { 6, 2, 4 }
elements of B:  { 16, 4, 2 }
elements of C:  { 16, 4, 12 }
elements of A union with B: { 6, 2, 4, 16 }
elements of B intersect with C:  { 16, 4 }
elements of C:  { 16, 4, 12 }
elements of A: { 6, 2, 16 }
*/


