# lab10 - Lab 10 Source File Input Output Value...

This preview shows pages 1–2. Sign up to view the full content.

Lab 10 Due Date: Monday, September 19, 2011 Source File: ~/2305/lab10.(C|CPP|cpp|c++|cc|cxx|cp) Input: Under control of main function Output: Under control of main function Value: 3 The purpose of this assignment is to become more familiar with the process of providing overloaded operators for a class. The IntegerSet class from Labs 04, 06, and 08 will be modiFed to provide: overloaded operators to compute the union, intersection, di±erence, and symmetric di±erence of two IntegerSet s, and overloaded operators to implement equality, subset, and proper subset. Some useful deFnitions: Two sets A and B are said to be equal if every element of A is an element of B and every element of B is an element of A . Set A is said to be a subset of set B if and only if each element of A is an element of B . Set A is said to be a proper subset of set B if A is a subset of B and at least one member of B is not a member of A . A header Fle is shown in ²igure 1, a sample main function for testing your implementation is shown in ²igure 2, a sample data Fle is shown in ²igure 3, and a sample execution sequence is shown in ²igure 4. To use the Makefile as distributed in class, add a target of lab10 to targets2srcfileswithlibrary . 1 #ifndef LAB10_H 2 #define LAB10_H 3 4 #include <iostream> 5 #include <bits.h> 6 7 using namespace std; 8 9 const uint N = 48; 10 11 class IntegerSet 12 { 13 // overloaded output operator for printing IntegerSet set to 14 // output stream out 15 friend ostream& operator 16 public: 17 IntegerSet(); // initializes the set to the empty 18 // set 19 IntegerSet(const IntegerSet& otherSet); // copy constructor 20 ~IntegerSet(); // destructor 21 bool IsMember(uint e) const; // returns true if e is a member of 22 // the set and false otherwise 23 uint Cardinality() const; // cardinality of a set 24 IntegerSet operator+(uint e) const; // if e is valid and not a member of 25 //

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

lab10 - Lab 10 Source File Input Output Value...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online