Create class integerset

Assignment Help C/C++ Programming
Reference no: EM1318984

(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[i] is true if integer i is in the set. Element a[j] is false if integer j is not in the set. Member functions include 

The default constructor: initializes a set to the so-called “empty set,” i.e., a set for which all elements contain false. 

additional constructor: receives an array of integers and the size of that array and uses the array to initialize a set object. 

unionOfSets: creates a third IntegerSet, as return value of the function, that is the 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).

intersectionOfSets: creates a third IntegerSet, as return value of the function, that is the 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). 

insertElement: places a new integer k into a set by setting a[k] to true. Return void. 

deleteElement: deletes integer m by setting a[m] to false. Return void. 

printSet: 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. Return void. 

isEqualTo: determines whether two sets are equal. Return bool. 

Now write a driver program to test your IntegerSet class. Instantiate several IntegerSet objects. 
Test that all your member functions work properly. 
Additional requirements: 
  • Include your first name in output and screenshot. 
  • Add “const” to appropriate formal parameters, and member functions. 
  • State purpose, pre-conditions, and post-conditions for each function. 
  • Add proper comments to code. 
  • Check boundary and error conditions without crash. 
  • Turn in the following as separate files: 
  • IntergerSet.h: class declaration 
  • IntergerSet.cpp: class implementation 
  • testIntegerSet.cpp: driver program 
  • Screenshots of output

Reference no: EM1318984

Questions Cloud

Full-time positions by contingent workers : You may offer suggestions with any combination of the contingent staff discussed in our textbook. You will need to cover ten full-time positions using contingent workers.
A supplier and a buyer, who are both risk neutral : A supplier and a buyer, who are both risk neutral, play the following game,  The buyer’s payoff is q^'-s^', and the supplier’s payoff is s^'-C(q^'), where C() is a strictly convex cost function with C(0)=C’(0)=0. These payoffs are commonly known.
What are the 5 elements that stroke : What are the 5 elements that stroke you the most in Indian consumer culture,   What are the 5  retail specificities (any type of format) that grabbed your attention in India, 3. How is luxury (and also the idea of sacredness) expressed in Indian r..
Prepare the bank reconciliation : Prepare the accounting records for Tanya's Tutoring Service (Version A),    Set up the Chart of Accounts,  Prepare the bank reconciliation for January 31, 2013
Create class integerset : 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[i] is true if integer i is in the set. Element a[j] is false if integer j is not in the set..
Write a driver program called testrationalnumber.cpp : Write a driver program called testRationalNumber.cpp to test each of the above functions and overloaded operators in the RationalNumber class.
Fundamentals of public health law : Fundamentals of Public Health Law,   Write a memo, not exceeding 600 words, analyzing this question. Assume that the public health necessity holding of  Jacobson is still good and valid law and has not been superseded or modified by any subsequen..
Cloud computing to the rescue : Cloud computing provides scalable computing resources, software applications, data storage, and networking infrastructure at cost below what would cost an organization to provide an equivalent infrastructure internally.
Mean and standard deviation of the sample mean : For sample of size 100, what is the mean and standard deviation of the sample mean.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Give students practice in writing and calling their function

To give students practice in writing and calling their own functions. To give students practice in implementing and planning complex programs.

  Public transport fare ticketing system

Implement and test a public transport fare ticketing system.

  Recognition of the problem by the hsbc

What problem did the HSBC face in this case? What people, technology, and the organization factors were responsible for problem? Did HSBC management correctly recognize the problem?

  Create a program that maintains the required book catalog

Create a program that maintains the required book catalog for the circulation desk of a library.

  Write a program for find greatest common divisor

Write code for a recursive implementation of Euclid's algorithm

  Write a driver program called testrationalnumber.cpp

Write a driver program called testRationalNumber.cpp to test each of the above functions and overloaded operators in the RationalNumber class.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Write the code

Write a program that allows an instructor to keep a grade book. Each students has scores for exams, homework assignments, and quizzes.

  A hierarchical jpeg encode decoder for greyscale images

This project is to develop a program that implements a hierarchical JPEG encoder/decoder for greyscale images.

  Construct vector and linked lists data structures

You will prepare sorted versions of the Linked Lists and Vector data structures developed in class

  Programmingto compute the volume of water in the cubic feet

Write down an algorithm (Programming in C) in order to compute the volume of water in the cubic feet, flowing through a pipe of diameter d in feet, having a velocity of v feet per second.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd