|
class IntSet
{
private:
vector <int> Ints;
int element [100];
int n, seeknumber;
public:
IntSet ()
{
cout << "Enter the following integer:";
cin >> n;
for (long i = 0; i <n; i ++)
{
cin >> element [i];
Ints.push_back (element [i]);
};
cout << endl << Ints [0];
};
Empty () {Ints.clear ();};
Isempty () {if (Ints.empty ()) cout << "The collection is empty!" << endl;};
bool Ismemberof ()
{
cout << "To determine if this number is inside the collection, please enter this number:";
cin >> seeknumber;
for (long j = 0; j <n; j ++)
Ranch
if (Ints [j] == seeknumber) return true;
Ranch
};
Add () {};
Sub () {};
Isequal () {};
Intersection () {};
Merge () {};
Print () {};
}; |
|