SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
C++
using namespace std;
Attach the code or leave jn here please
3. Write a class intset for modeling sets of integers in the range 0 through 99. A set should be
represented internally as an array of type bool: The i th array element will be true whenever
integer i is in the set and will be false whenever integer i is not in the set. Include a no-argument
constructor that initializes a set to the so-called "empty set," i.e., a set whose array representation
contains all false values. The class should include the following overloaded operators: + to
perform the union of two set (the union of sets A and B is the set that contains all elements of set
A or set B, or both). * to perform the intersection of two sets (the intersection of sets A and B is the
set that contains all elements in both set A and set B.) - to form the difference of two sets (the
difference of sets A and B is the set containing those elements that are in A but not in B ) += to
add an integer into a set. - to delete an integer from a set. = to determine if two sets are equal. 1 to
form the complement of a set (the complement of setA, denoted A, is the set containing all the
elements in the universal set that are not in A - the universal set for this problem is the set
containing all integers between 0 and 99 ) = to determine if one set is a subset of another set (set
A is a subset of set B means that for any element x in A,x is also an element of set B ). to display a
set in roster notation (for example, {2,3,5,9} ) Requirement: The overloaded += and = operators
should check for valid integer input (in the range 099 ), or if an add-item is already in the set, or if a
delete-item is not in the set. An error message for invalid input should be generated. Then, write a
C++ program that uses the new Intset class. The program should allow the user to repeatedly
select from these options: - add numbers to a set - renove numbers from a set - form the union of
two sets - form the intersection of two sets - form the difference of two sets - determine if two sets
are equal - form the complement of an set - determine if one set is a subset of another setThen,
write a C++ program that uses the new Intset class. The program should allow the user to
repeatedly select from these options: - add numbers to a set - remove numbers from a set - form
the union of two sets - form the intersection of two sets - form the difference of two sets -
determine if two sets are equal - form the complement of an set - determine if one set is a subset
of another set - display a set The program should allow for up to ten sets to be created during a
given program run. Use any standalone functions you feel necessary. Here is output from a
sample run of the program (user input in bold): Select an option: 1 - add numbers to a set -
remove numbers from a set - form the union of two sets - form the intersection of two sets - form
the difference of two sets - determine if two sets are equal 7. form the complement of an set 8 -
determine if one set is a subset of another set 9 - display a set 10 - Exit1 Add numbers to which
sets (A, B,C, D, E, F, G, H, I, J)? : A Enter number to add: 1 Add another ( y or n ): y Enter number
to add: 3 Add another ( y or n ): y Enter number to add: 8 Add another (y or n) : n Select an option:
1 - add numbers to a set - remove numbers from a set - form the union of two sets - form the
intersection of two sets - form the difference of two sets - determine if two sets are equal - form the
complement of an set - determine if one set is a subset of another set - display a set 10 - Exit 9
Display set (A, B, C, D, E, F, G, H, I, J)? :A {1,3,8} Select an option: 1 - add numbers to a set 2 -
remove numbers from a set - form the union of two sets - form the intersection of two sets - form
the difference of two sets - determine if two sets are equal - form the complement of an set -
determine if one set is a subset of another set 9 - display a set 10 - Exit1 Add numbers to which
sets (A,B,C,D,E,F,G,H,I,J) ? :B Enter number to add: 2 Add another (y or n) : y Enter number to
add: 3 Add another (y or n ): y Enter number to add: 7 Add another (y or n):n Select an option: 1 -
add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets 4 - form the
intersection of two sets - form the difference of two sets - determine if two sets are equal - form the
complement of an set 8 - determine if one set is a subset of another set 9 - display a set 10 - Exit 2
Remove numbers from which set (A,B,C,D,E,F,G,H,I,J) ? :A Enter number to remove: 1 Remove
another (y or n):nSelect an option: - add numbers to a set - remove numbers from a set - form the
union of two sets - form the intersection of two sets - form the difference of two sets - determine if
two sets are equal - form the complement of an set - determine if one set is a subset of another
set 9 - display a set 10 - Exit 3 Sets union - specify sets to use: First set: (A, B, C, D, E, F, G, H, I,
J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)? :B Result set: (A, B, C, D, E, F, G, H, I, J)? :C
Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two
sets 4 - form the intersection of two sets 5 - form the difference of two sets 6 - determine if two
sets are equal 7 - form the complement of an set 8 - determine if one set is a subset of another set
9 - display a set 10 - Exit 4 Set intersection - specify sets to use: First set: (A, B, C, D, E, F, G, H,
I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)?:B Result set: (A, B, C, D, E, F, G, H, I, J)? :D9 -
display a set 10 - Exit 3 Sets union - specify sets to use: First set: (A, B, C, D, E, F, G, H, I, J)? :A
Second set: (A, B, C, D, E, F, G, H, I, J)? :B Result set: (A, B, C, D, E, F, G, H, I, J)? :C Select an
option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets 4 -
form the intersection of two sets 5 - form the difference of two sets 6 - determine if two sets are
equal 7 - form the complement of an set 8 - determine if one set is a subset of another set 9 -
display a set 10 Exit 4 Set intersection - specify sets to use: First set: (A, B, C, D, E, F, G, H, I, J)?
:A Second set: (A, B, C, D, E, F, G, H, I, J)? :B Result set: (A,B, C, D, E, F, G, H, I, J)? :D Select
an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two
setsSelect an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of
two sets 4 - form the intersection of two sets - form the difference of two sets - determine if two
sets are equal - form the complement of an set - determine if one set is a subset of another set -
display a set 10 - Exit 5 Set difference - specify sets to use: First set: (A, B, C, D, E, F, G, H, I, J)?
:A Second set: (A, B, C, D, E, F, G, H, I, J)? :B Result set: (A, B, C, D, E, F, G, H, I, J)? :E Select
an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets -
form the intersection of two sets - form the difference of two sets - determine if two sets are equal -
form the complement of an set - determine if one set is a subset of another set - display a setSet
equality - specify sets to compare: First set: (A, B, C, D, E, F, G, H, I, J)? :A Second set: (A, B, C,
D, E, F, G, H, I, J)? :B These sets are not equal Select an option: 1 - add numbers to a set 2 -
remove numbers from a set 3 - form the union of two sets 4 - form the intersection of two sets 5 -
form the difference of two sets 6 - determine if two sets are equal 7 - form the complement of an
set 8 - determine if one set is a subset of another set. 9 - display a set 10 - Exit 7 Set complement
- specify sets to use: Complement set: (A, B, C, D, E, F, G, H, I, J)? :A Result set: (A, B, C, D, E,
F, G, H, I, J)? :F Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 -
form the union of two sets 4 - form the intersection of two sets 5 - form the difference of two sets 6
- determine if two sets are equal 7 - form the complement of an set 8 - determine if one set is a
subset of another set 9 - display a set8 Subsets - specify sets to compare: First set: (A, B, C, D, E,
F, G, H, I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)?:B The first set is not a subset of the
second Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the
union of two sets - form the intersection of two sets - form the difference of two sets - determine if
two sets are equal - form the complement of an set - determine if one set is a subset of another
set 9 - display a set 10 Exit 9 Display set (A, B, C, D, E, F, G, H, I, J)? :B {2,3,7} Select an option:
1 - add numbers to a set 2 - remove numbers from a set - form the union of two sets - form the
intersection of two sets - form the difference of two sets - determine if two sets are equal - form the
complement of an set - determine if one set is a subset of another set - display a set 10 - Exit 10

Weitere ähnliche Inhalte

Ähnlich wie C++ using namespace std Attach the code or leave jn h.pdf

Set Concepts
Set ConceptsSet Concepts
Set Concepts
shbest
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
stopgolook
 

Ähnlich wie C++ using namespace std Attach the code or leave jn h.pdf (15)

#17 Boba PPT Template (1).pptx
#17 Boba PPT Template (1).pptx#17 Boba PPT Template (1).pptx
#17 Boba PPT Template (1).pptx
 
Discrete mathematic
Discrete mathematicDiscrete mathematic
Discrete mathematic
 
4 ESO Academics - Unit 01 - Exercises 1.3.
4 ESO Academics - Unit 01 - Exercises 1.3.4 ESO Academics - Unit 01 - Exercises 1.3.
4 ESO Academics - Unit 01 - Exercises 1.3.
 
functions and sets.pdf
functions and sets.pdffunctions and sets.pdf
functions and sets.pdf
 
functions and sets.pdf
functions and sets.pdffunctions and sets.pdf
functions and sets.pdf
 
Section3 1
Section3 1Section3 1
Section3 1
 
Q1 Week 1 Lesson -Concepts of Sets and Operation on Sets.pptx
Q1 Week 1 Lesson -Concepts of Sets and Operation on Sets.pptxQ1 Week 1 Lesson -Concepts of Sets and Operation on Sets.pptx
Q1 Week 1 Lesson -Concepts of Sets and Operation on Sets.pptx
 
Set Concepts
Set ConceptsSet Concepts
Set Concepts
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
 
Math 116 pres. 5
Math 116 pres. 5Math 116 pres. 5
Math 116 pres. 5
 
ICSE class X maths booklet with model paper 2015
ICSE class X  maths booklet with model paper 2015ICSE class X  maths booklet with model paper 2015
ICSE class X maths booklet with model paper 2015
 
NumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxNumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptx
 
Data transformation-cheatsheet
Data transformation-cheatsheetData transformation-cheatsheet
Data transformation-cheatsheet
 
Set, Relations and Functions
Set, Relations and FunctionsSet, Relations and Functions
Set, Relations and Functions
 
Fuvest 2020 - aberta
Fuvest 2020 - abertaFuvest 2020 - aberta
Fuvest 2020 - aberta
 

Mehr von akshpatil4

can you help me write this code in Net Maui App please than.pdf
can you help me write this code in Net Maui App please than.pdfcan you help me write this code in Net Maui App please than.pdf
can you help me write this code in Net Maui App please than.pdf
akshpatil4
 
Can You build the web based project Homepage for me Home .pdf
Can You build the web based project Homepage for me   Home .pdfCan You build the web based project Homepage for me   Home .pdf
Can You build the web based project Homepage for me Home .pdf
akshpatil4
 
Can You build the web based project for me Home Page Aft.pdf
Can You build the web based project for me   Home Page Aft.pdfCan You build the web based project for me   Home Page Aft.pdf
Can You build the web based project for me Home Page Aft.pdf
akshpatil4
 
can you break this down in python codes please Task 1 Cre.pdf
can you break this down in python codes please  Task 1 Cre.pdfcan you break this down in python codes please  Task 1 Cre.pdf
can you break this down in python codes please Task 1 Cre.pdf
akshpatil4
 
Can someone solve the TODO parts of the following problem i.pdf
Can someone solve the TODO parts of the following problem i.pdfCan someone solve the TODO parts of the following problem i.pdf
Can someone solve the TODO parts of the following problem i.pdf
akshpatil4
 
Can someone please help me implement the addSong function .pdf
Can someone please help me implement the addSong function .pdfCan someone please help me implement the addSong function .pdf
Can someone please help me implement the addSong function .pdf
akshpatil4
 
Can someone please help me complete the add_song function .pdf
Can someone please help me complete the add_song function .pdfCan someone please help me complete the add_song function .pdf
Can someone please help me complete the add_song function .pdf
akshpatil4
 
can someone please assist me with analysis of this case atud.pdf
can someone please assist me with analysis of this case atud.pdfcan someone please assist me with analysis of this case atud.pdf
can someone please assist me with analysis of this case atud.pdf
akshpatil4
 
Can someone help with these functions doAddTweet doEditTwe.pdf
Can someone help with these functions  doAddTweet doEditTwe.pdfCan someone help with these functions  doAddTweet doEditTwe.pdf
Can someone help with these functions doAddTweet doEditTwe.pdf
akshpatil4
 

Mehr von akshpatil4 (20)

Calculate the amount of money Paige had to deposit in an inv.pdf
Calculate the amount of money Paige had to deposit in an inv.pdfCalculate the amount of money Paige had to deposit in an inv.pdf
Calculate the amount of money Paige had to deposit in an inv.pdf
 
Cada ao en los Estados Unidos cientos de iglesias cristian.pdf
Cada ao en los Estados Unidos cientos de iglesias cristian.pdfCada ao en los Estados Unidos cientos de iglesias cristian.pdf
Cada ao en los Estados Unidos cientos de iglesias cristian.pdf
 
Can you please add comments so I can understand it Thank yo.pdf
Can you please add comments so I can understand it Thank yo.pdfCan you please add comments so I can understand it Thank yo.pdf
Can you please add comments so I can understand it Thank yo.pdf
 
can you help me write this code in Net Maui App please than.pdf
can you help me write this code in Net Maui App please than.pdfcan you help me write this code in Net Maui App please than.pdf
can you help me write this code in Net Maui App please than.pdf
 
Can you help me with these two questions I will give you a .pdf
Can you help me with these two questions I will give you a .pdfCan you help me with these two questions I will give you a .pdf
Can you help me with these two questions I will give you a .pdf
 
Can you help me design this interface in HTML Flight Find.pdf
Can you help me design this interface in HTML   Flight Find.pdfCan you help me design this interface in HTML   Flight Find.pdf
Can you help me design this interface in HTML Flight Find.pdf
 
Can You build the web based project Homepage for me Home .pdf
Can You build the web based project Homepage for me   Home .pdfCan You build the web based project Homepage for me   Home .pdf
Can You build the web based project Homepage for me Home .pdf
 
Can You build the web based project for me Home Page Aft.pdf
Can You build the web based project for me   Home Page Aft.pdfCan You build the web based project for me   Home Page Aft.pdf
Can You build the web based project for me Home Page Aft.pdf
 
can you break this down in python codes please Task 1 Cre.pdf
can you break this down in python codes please  Task 1 Cre.pdfcan you break this down in python codes please  Task 1 Cre.pdf
can you break this down in python codes please Task 1 Cre.pdf
 
Can someone explain this to me step by step Consider a give.pdf
Can someone explain this to me step by step Consider a give.pdfCan someone explain this to me step by step Consider a give.pdf
Can someone explain this to me step by step Consider a give.pdf
 
Can you answer these True or False questions for me please .pdf
Can you answer these True or False questions for me please .pdfCan you answer these True or False questions for me please .pdf
Can you answer these True or False questions for me please .pdf
 
Can someone please help with this Now that you have compl.pdf
Can someone please help with this  Now that you have compl.pdfCan someone please help with this  Now that you have compl.pdf
Can someone please help with this Now that you have compl.pdf
 
Can someone solve the TODO parts of the following problem i.pdf
Can someone solve the TODO parts of the following problem i.pdfCan someone solve the TODO parts of the following problem i.pdf
Can someone solve the TODO parts of the following problem i.pdf
 
Calculate the amount of money Dylan had to deposit in an inv.pdf
Calculate the amount of money Dylan had to deposit in an inv.pdfCalculate the amount of money Dylan had to deposit in an inv.pdf
Calculate the amount of money Dylan had to deposit in an inv.pdf
 
Can someone please help me implement the addSong function .pdf
Can someone please help me implement the addSong function .pdfCan someone please help me implement the addSong function .pdf
Can someone please help me implement the addSong function .pdf
 
Can someone please help me complete the add_song function .pdf
Can someone please help me complete the add_song function .pdfCan someone please help me complete the add_song function .pdf
Can someone please help me complete the add_song function .pdf
 
can someone please assist me with analysis of this case atud.pdf
can someone please assist me with analysis of this case atud.pdfcan someone please assist me with analysis of this case atud.pdf
can someone please assist me with analysis of this case atud.pdf
 
can someone help me with this class ENVS 200040 Pollution.pdf
can someone help me with this class ENVS 200040   Pollution.pdfcan someone help me with this class ENVS 200040   Pollution.pdf
can someone help me with this class ENVS 200040 Pollution.pdf
 
Can someone help me with these questions 1 Main structures.pdf
Can someone help me with these questions 1 Main structures.pdfCan someone help me with these questions 1 Main structures.pdf
Can someone help me with these questions 1 Main structures.pdf
 
Can someone help with these functions doAddTweet doEditTwe.pdf
Can someone help with these functions  doAddTweet doEditTwe.pdfCan someone help with these functions  doAddTweet doEditTwe.pdf
Can someone help with these functions doAddTweet doEditTwe.pdf
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

C++ using namespace std Attach the code or leave jn h.pdf

  • 1. C++ using namespace std; Attach the code or leave jn here please 3. Write a class intset for modeling sets of integers in the range 0 through 99. A set should be represented internally as an array of type bool: The i th array element will be true whenever integer i is in the set and will be false whenever integer i is not in the set. Include a no-argument constructor that initializes a set to the so-called "empty set," i.e., a set whose array representation contains all false values. The class should include the following overloaded operators: + to perform the union of two set (the union of sets A and B is the set that contains all elements of set A or set B, or both). * to perform the intersection of two sets (the intersection of sets A and B is the set that contains all elements in both set A and set B.) - to form the difference of two sets (the difference of sets A and B is the set containing those elements that are in A but not in B ) += to add an integer into a set. - to delete an integer from a set. = to determine if two sets are equal. 1 to form the complement of a set (the complement of setA, denoted A, is the set containing all the elements in the universal set that are not in A - the universal set for this problem is the set containing all integers between 0 and 99 ) = to determine if one set is a subset of another set (set A is a subset of set B means that for any element x in A,x is also an element of set B ). to display a set in roster notation (for example, {2,3,5,9} ) Requirement: The overloaded += and = operators should check for valid integer input (in the range 099 ), or if an add-item is already in the set, or if a delete-item is not in the set. An error message for invalid input should be generated. Then, write a C++ program that uses the new Intset class. The program should allow the user to repeatedly select from these options: - add numbers to a set - renove numbers from a set - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another setThen, write a C++ program that uses the new Intset class. The program should allow the user to repeatedly select from these options: - add numbers to a set - remove numbers from a set - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another set - display a set The program should allow for up to ten sets to be created during a given program run. Use any standalone functions you feel necessary. Here is output from a sample run of the program (user input in bold): Select an option: 1 - add numbers to a set - remove numbers from a set - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal 7. form the complement of an set 8 - determine if one set is a subset of another set 9 - display a set 10 - Exit1 Add numbers to which sets (A, B,C, D, E, F, G, H, I, J)? : A Enter number to add: 1 Add another ( y or n ): y Enter number
  • 2. to add: 3 Add another ( y or n ): y Enter number to add: 8 Add another (y or n) : n Select an option: 1 - add numbers to a set - remove numbers from a set - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another set - display a set 10 - Exit 9 Display set (A, B, C, D, E, F, G, H, I, J)? :A {1,3,8} Select an option: 1 - add numbers to a set 2 - remove numbers from a set - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another set 9 - display a set 10 - Exit1 Add numbers to which sets (A,B,C,D,E,F,G,H,I,J) ? :B Enter number to add: 2 Add another (y or n) : y Enter number to add: 3 Add another (y or n ): y Enter number to add: 7 Add another (y or n):n Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets 4 - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set 8 - determine if one set is a subset of another set 9 - display a set 10 - Exit 2 Remove numbers from which set (A,B,C,D,E,F,G,H,I,J) ? :A Enter number to remove: 1 Remove another (y or n):nSelect an option: - add numbers to a set - remove numbers from a set - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another set 9 - display a set 10 - Exit 3 Sets union - specify sets to use: First set: (A, B, C, D, E, F, G, H, I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)? :B Result set: (A, B, C, D, E, F, G, H, I, J)? :C Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets 4 - form the intersection of two sets 5 - form the difference of two sets 6 - determine if two sets are equal 7 - form the complement of an set 8 - determine if one set is a subset of another set 9 - display a set 10 - Exit 4 Set intersection - specify sets to use: First set: (A, B, C, D, E, F, G, H, I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)?:B Result set: (A, B, C, D, E, F, G, H, I, J)? :D9 - display a set 10 - Exit 3 Sets union - specify sets to use: First set: (A, B, C, D, E, F, G, H, I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)? :B Result set: (A, B, C, D, E, F, G, H, I, J)? :C Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets 4 - form the intersection of two sets 5 - form the difference of two sets 6 - determine if two sets are equal 7 - form the complement of an set 8 - determine if one set is a subset of another set 9 - display a set 10 Exit 4 Set intersection - specify sets to use: First set: (A, B, C, D, E, F, G, H, I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)? :B Result set: (A,B, C, D, E, F, G, H, I, J)? :D Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two setsSelect an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets 4 - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another set - display a set 10 - Exit 5 Set difference - specify sets to use: First set: (A, B, C, D, E, F, G, H, I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)? :B Result set: (A, B, C, D, E, F, G, H, I, J)? :E Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another set - display a setSet equality - specify sets to compare: First set: (A, B, C, D, E, F, G, H, I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)? :B These sets are not equal Select an option: 1 - add numbers to a set 2 -
  • 3. remove numbers from a set 3 - form the union of two sets 4 - form the intersection of two sets 5 - form the difference of two sets 6 - determine if two sets are equal 7 - form the complement of an set 8 - determine if one set is a subset of another set. 9 - display a set 10 - Exit 7 Set complement - specify sets to use: Complement set: (A, B, C, D, E, F, G, H, I, J)? :A Result set: (A, B, C, D, E, F, G, H, I, J)? :F Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets 4 - form the intersection of two sets 5 - form the difference of two sets 6 - determine if two sets are equal 7 - form the complement of an set 8 - determine if one set is a subset of another set 9 - display a set8 Subsets - specify sets to compare: First set: (A, B, C, D, E, F, G, H, I, J)? :A Second set: (A, B, C, D, E, F, G, H, I, J)?:B The first set is not a subset of the second Select an option: 1 - add numbers to a set 2 - remove numbers from a set 3 - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another set 9 - display a set 10 Exit 9 Display set (A, B, C, D, E, F, G, H, I, J)? :B {2,3,7} Select an option: 1 - add numbers to a set 2 - remove numbers from a set - form the union of two sets - form the intersection of two sets - form the difference of two sets - determine if two sets are equal - form the complement of an set - determine if one set is a subset of another set - display a set 10 - Exit 10