SlideShare a Scribd company logo
1 of 3
Download to read offline
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

More Related Content

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

#17 Boba PPT Template (1).pptx
#17 Boba PPT Template (1).pptx#17 Boba PPT Template (1).pptx
#17 Boba PPT Template (1).pptxKimSeungyoon2
 
Discrete mathematic
Discrete mathematicDiscrete mathematic
Discrete mathematicNaralaswapna
 
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.Gogely The Great
 
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.pptxNovyFacun1
 
Set Concepts
Set ConceptsSet Concepts
Set Conceptsshbest
 
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.pdfstopgolook
 
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 2015APEX INSTITUTE
 
NumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxNumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxJohnWilliam111370
 

Similar to C++ using namespace std Attach the code or leave jn h.pdf (12)

#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.
 
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
 
Fuvest 2020 - aberta
Fuvest 2020 - abertaFuvest 2020 - aberta
Fuvest 2020 - aberta
 

More from akshpatil4

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.pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 
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 .pdfakshpatil4
 
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.pdfakshpatil4
 
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 .pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 
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 .pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 
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 .pdfakshpatil4
 
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 .pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 
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.pdfakshpatil4
 

More from 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
 

Recently uploaded

Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45MysoreMuleSoftMeetup
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Celine George
 
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxHVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxKunal10679
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdfVikramadityaRaj
 
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfFinancial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfMinawBelay
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Denish Jangid
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxMohamed Rizk Khodair
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17Celine George
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptxPoojaSen20
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxCeline George
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryEugene Lysak
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdfKamal Acharya
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Celine George
 
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Mark Carrigan
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxNehaChandwani11
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 

Recently uploaded (20)

Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxHVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdfFinancial Accounting IFRS, 3rd Edition-dikompresi.pdf
Financial Accounting IFRS, 3rd Edition-dikompresi.pdf
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptx
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdf
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptx
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 

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