// Project 2: Sets in C++ // // A Sample main() // // Author: James Kukla // Date: 18 February 2000 // // Purpose: // This file provides an initial test of your Set implementation for // project 2. You should make sure to write some tests of your own to test // all cases possible; these tests are NOT exhaustive. // // Good luck! #include #include "Set.H" void main() { Set A, B, C; cout << "Testing whether A == {}: " << (A.isEmpty() ? "yes" : "no") << endl; A.add(1); A.add(2); A.add(3); B.add(1); B.add(4); B.add(8); C = A || B; cout << "A: "; A.print(); cout << endl; cout << "B: "; B.print(); cout << endl; cout << "C = A || B: "; C.print(); cout << endl; C = A && B; cout << "C = A && B: "; C.print(); cout << endl; cout << "A < B: " << (A < B ? "yes" : "no") << endl; cout << "A > B: " << (A > B ? "yes" : "no") << endl; cout << "Deleting 4 from B..." << endl; B.remove(4); cout << "B: "; B.print(); cout << endl; }