Question: I need help for my C++ program . It requires to add what is asked bellow to a code that I already have. UnionOps part
I need help for my C++ program. It requires to add what is asked bellow to a code that I already have. UnionOps part is important C++ please( don't copy and paste please)
This is all I have the main point of this program is to find the unionOps of these, I put in bold what it does
REQUIREMENT:
Create a class called
Sets
for positive integers that will have the following functions:
addElement , will take a positive integer and add it to the set
getElement, will take a position number and return the element at the position (return -1 if bad
position)
getSize, return the size of the set
isSubset, takes a sets object (call it b) and see if the current set (call it a) is a subset of b. If so, return a
Boolean true, else return a Boolean false
isProper, takes a sets object (call it b) and see if the current set (call it a) is a proper subset of b. Note,
use the isSubset function first then see if b has at least one more element than a
/*printOrderedPairs, takes a sets object (call it b) and takes the current set (call it a) and prints the
ordered pairs of of A X B*/
unionOps, that takes a Sets object and does a union with the current set
intersection, that takes a Sets object and does an intersection with the current set
printSet, will print the Sets object contents
It is recommended to add a constructor that will take an array and add its elements to the current set. Define a set a with certain values, like 1, 2, 3, 4 and set b with certain values like 3, 4, 5, 6
Have main create three objects: setA with set a, setB with set b, and setC with set a.
Print the setA, setB, setC
Do an union of setA with setB (setA will be changed) then print setA
Do an intersection of setC (setC will be changed) with setB then print setC
For C++, submit a header file, an implementation file, and a main file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
