Advertisement
yaffar

Untitled

Mar 10th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. class Set {
  2.     private:
  3.         std::vector<int> _vec;  // vector to store the integers
  4.         int _evens;             // number of even integers in the set
  5.     public:
  6.         Set();
  7.         void putIn(int e);      // put an integer in - check if it's already there and increase _evens if the number is even
  8.         void deleteItem(int e); // delete an integer from the set
  9.         bool isIn(int e);       // check if e is in the set
  10.         int getEvens();         // get the number of even numbers - stored in _evens
  11.         void print();           // print the integers stored in set
  12.  
  13.         friend std::ostream& operator<< (std::ostream& s, const Set& a);
  14. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement