IntegerSet Class

Download Category:

Integer_Set_CPP.zip - (604.25 KB)
[
Integer_Set_CPP/Debug/
Integer_Set_CPP/Debug/cl.command.1.tlog
Integer_Set_CPP/Debug/CL.read.1.tlog
Integer_Set_CPP/Debug/CL.write.1.tlog
Integer_Set_CPP/Debug/ex09_21.obj
Integer_Set_CPP/Debug/Integer_Set_CPP.exe
Integer_Set_CPP/Debug/Integer_Set_CPP.exe.embed.manifest
Integer_Set_CPP/Debug/Integer_Set_CPP.exe.embed.manifest.res
Integer_Set_CPP/Debug/Integer_Set_CPP.exe.intermediate.manifest
Integer_Set_CPP/Debug/Integer_Set_CPP.ilk
Integer_Set_CPP/Debug/Integer_Set_CPP.lastbuildstate
Integer_Set_CPP/Debug/Integer_Set_CPP.log
Integer_Set_CPP/Debug/Integer_Set_CPP.pdb
Integer_Set_CPP/Debug/Integer_Set_CPP.vcxprojResolveAssemblyReference.cache
Integer_Set_CPP/Debug/Integer_Set_CPP.write.1.tlog
Integer_Set_CPP/Debug/Integer_Set_CPP_manifest.rc
Integer_Set_CPP/Debug/IntegerSet.obj
Integer_Set_CPP/Debug/link.1664.read.1.tlog
Integer_Set_CPP/Debug/link.1664.write.1.tlog
Integer_Set_CPP/Debug/link.1664-cvtres.read.1.tlog
Integer_Set_CPP/Debug/link.1664-cvtres.write.1.tlog
Integer_Set_CPP/Debug/link.command.1.tlog
Integer_Set_CPP/Debug/link.read.1.tlog
Integer_Set_CPP/Debug/link.write.1.tlog
Integer_Set_CPP/Debug/link-cvtres.read.1.tlog
Integer_Set_CPP/Debug/link-cvtres.write.1.tlog
Integer_Set_CPP/Debug/mt.command.1.tlog
Integer_Set_CPP/Debug/mt.read.1.tlog
Integer_Set_CPP/Debug/mt.write.1.tlog
Integer_Set_CPP/Debug/rc.command.1.tlog
Integer_Set_CPP/Debug/rc.read.1.tlog
Integer_Set_CPP/Debug/rc.write.1.tlog
Integer_Set_CPP/Debug/vc100.idb
Integer_Set_CPP/Debug/vc100.pdb
Integer_Set_CPP/ex09_21.cpp
Integer_Set_CPP/Integer_Set_CPP.sln
Integer_Set_CPP/Integer_Set_CPP.suo
Integer_Set_CPP/Integer_Set_CPP.vcxproj
Integer_Set_CPP/Integer_Set_CPP.vcxproj.filters
Integer_Set_CPP/Integer_Set_CPP.vcxproj.user
Integer_Set_CPP/IntegerSet.cpp
Integer_Set_CPP/IntegerSet.h
Integer_Set_CPP/Question.txt
Integer_Set_CPP/Screenshot_1.png
]

(IntegerSet Class)
Create class IntegerSet for which each object can hold integers in the range 0 through 100. Represent the set internally as a vector of bool values. Element a is true if integer I is in the set. Element a[j] is false if integer j is not in the set. The default constructor initializes a set to the s-called “empty set,” i.e., a set for which all elements contain false.
Provide member functions for the common set operations. For example, provide a unionOfSets member function that creates a third set that is the set-theoretic union of two existing sets (i.e., an element of the result is set to true if that element is true in either or both of the existing sets, and an element of the result is set to false if that element is false in each of the existing sets).
Provide an intersectionOfSets member function which creates a third set which is the set-theoretic intersection of two existing sets (i.e., an element of the result is set to false if that element is false in either or both of the existing sets, and an element of the result is set to true if that element is true in each of the existing sets).
Provide an insertElement member function that places a new integer k into a set by setting a[k] to true. Provide a deleteElement member function that deletes integer m by setting a[m] to false.
Provide a printSet member function that prints a set as a list of numbers separated by spaces. Print only those elements that are present in the set (i.e., their position in the vector has a value of true). Print — for an empty set.
Provide an isEqualTo member function that determines whether two sets are equal.
Provide an additional constructor that receives an array of integers and the size of that array and uses the array to initialize a set object.
Write a driver program to test your IntegerSet class. Instantiate several IntegerSet objects. Test that all your member functions work properly.

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.