Create a class integerSet for which every object can hold integers in the range 1 – 100use an internal array that holds ones and zeros to store elements in set. arr[ k ] = 1 if integer k is in the set and arr[ k ] = 0 if integer k is not in the set. Write a default constructor to initialize a set to an empty set and also write a copy constructor. A utility function isInRange must be implemented to test if the number is in range 1 – 100 or notUse the following class interface, integerSet, to write an implementation that supports
the following operators:
• (+) operator to insert an element
• (+) operator to find the union of two sets
• (-) operator to delete an element
• (-) operator to find elements in one set and not in the other
• (*) operator to find the intersection of two set
• (<<) operator to print the contents of a set.
• (!) operator to empty set.
class integerSet
{
friend ostream& operator<<(ostream&, integerSet);
friend operator! (integerSet &);
private:
int arr [ 101 ];
bool isInRange(int); // utility function to check if the number in range or not
public:
integerSet( ); // constructor to initialize object to an empty set
integerSet( const integrSet & ); //copy constructor
void operator + ( int ); // to insert element
integerSet operator + (integerSet); // to find the union of two sets
void operator - ( int ); // to delete element
integerSet operator - (integerSet); // to find elements in one set and not in the
//other set
integerSet operator * (integerSet); // to find the intersection of two sets
};