Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Plz follow the second and the third pic to write the code for set.h, and then write a main.cpp Implement the set class as specified

Plz follow the second and the third pic to write the code for set.h, and then write a main.cpp image text in transcribed
image text in transcribed
image text in transcribed
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 would 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions