Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Plz follow the comments from set.h(pic 2 and 3) to write set.cpp Implement the set class as specified in the provided Set.h file. You are
Plz follow the comments from set.h(pic 2 and 3) to write set.cpp
Implement the set class as specified in the provided Set.h file. You are NOT allowed to modify the Set.h file. It includes methods to check how many elements are in the set, add an element to the set, remove an element from the set, remove all elements from the set, check if an element is in the set, and check if one set is a subset of another. It specifies two stand-alone functions using operator overloading to union and take the difference of two sets. It specifies an output operator that must output the items in the set on one line separate by a comma and space. See the sample output below. for example, if a set contained 1, 2, 3, it vould output 1, 2, 3 for example if a set contained just 1, it would output Also write a main.cpp function that tests your set implementation. You may either use the C assert macro (see section 8.14 of the book) that will stop the program and tell you if an assertion fails or you may write code such as: Set a; if (a num Elements 0) cerr empty set does not have zero elements end else cerr You may assume that a set will never contain more than 100 elements since the Set class uses an array of size 100. Note that the operators are friends of the classes so they are allowed to access the private data of any Set instance Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started