Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main.cpp
- #include <iostream>
- #include "IntegerSet.h"
- using namespace std;
- void test(){
- IntegerSet y{};
- IntegerSet x{};
- cout << "Is x = y? " << x.isEqualTo(y) << endl;
- IntegerSet z{};
- for (int i = 0; i < 100; i++) {
- x.knock(1,i);
- if (i == 5) {x.knock(0,i);}
- }
- x.printSet();
- y.knock(1,5);
- y.printSet();
- cout << "union of set x and y: " << endl;
- x.unionOfSets(y).printSet();
- y.unionOfSets(z).printSet();
- x.intersectionOfSets(y).printSet();
- cout << "x set:";
- x.printSet();
- cout << "y set:";
- y.printSet();
- cout << "z set:";
- y.printSet();
- cout << x.isEqualTo(y) << endl;
- cout << x.isEqualTo(z) << endl;
- //vector<int> test1{0,1,0,1,1,0,1,0,1}; //to work properly, input vector size should = 100 or it will throw an exception, initialize to vector is tested though
- //IntegerSet q{test1};
- //q.printSet();
- cout << "x set:" << endl;
- cout << x.toString() << endl;
- cout << "y set:" << endl;
- cout << y.toString() << endl;
- }
- int main()
- {
- test();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement