Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I only need the IntegerSet.h file and IntegerSet.cpp file, thank you! For this programming assignment you will be creating a class named IntegerSet for which

image text in transcribed

image text in transcribed

I only need the IntegerSet.h file and IntegerSet.cpp file, thank you!

For this programming assignment you will be creating a class named 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 alil is true if integer i is in the set. Element ali] is false if integer j is not in the set. The default constructor initializes a set to the so-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) a. 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). b. Provide an insertElement member function that places a new integer k in to a set by setting a[k] to true. Provide a deleteElement member function that deletes integer m by setting a[m] to false. c. 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. d. e. Provide an isEquaITo 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

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

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

Organizing Your Speech Points

Answered: 1 week ago