USING VISUAL STUDIO C++
Create a templated class called Set that will use LinkedBag as a data member to be a “has a” implementation. The Set will have the following public functions:
int getCurrentSize()
void isEmpty()
bool add(const ItemType& newEntry)
bool remove(const ItemType& anEntry)
The above Set functions will invoke the data member LinkedBag. Note: there are no duplicates in the sets so the Set add should not allow duplicates (do NOT change the LinkedBag code). Also add to Set the following overloaded operator:
Set operator+(const Set&) // do a union
Set operator-(const Set&) // do an intersection
friend ostream& operator<<(ostream&, const Set&) // print the set
Put the class definition in Set.h, implementation in [login to view URL], and a main – 3 files all together. Have main create 3 Set objects that are unsigned integers then create a menu like so:
[login to view URL] elements to set1
[login to view URL] elements to set2
[login to view URL] an element from set1
[login to view URL] an element from set2
[login to view URL] a union of set1 and set2 into set3
[login to view URL] an intersection of set1 and set2 into set3
[login to view URL] set1, set2, and set3
[login to view URL]
Have the add elements loop and add positive integers until you enter a 0. You can create extra functions (separate from the Set class) to make it easier.
Printing would look like:
Which set to print? 1
Set 1 has 3 elements of:
11
5
33
With the overloaded operators, you should be able to do something like:
set3 = set1 + set2;
Hi there!
I will deliver the completed Implementation within 24 hours (after you have awarded the project ofcourse). Let me know if you want me to handle this project for you. Thanks for reading!!
Best,
Maher