Integerset class create class integerset for which each

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

(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: EM13357432

Questions Cloud

Elucidate explain why the cost structure associated with : elucidate explain why the cost structure associated with many kinds of information goods also services might imply a
A supplier and a buyer who are both risk neutral play the : a supplier and a buyer who are both risk neutral play the following game the buyer orders a good of quality q ge0 from
Brief of the discovery reportthe objective of this : brief of the discovery reportthe objective of this discovery report which comes from the ethnographic field is to write
Briana hope has had a long-standing love affair with : briana hope has had a long-standing love affair with technology and an appetite for apps. she believes that business
Integerset class create class integerset for which each : integerset class create class integerset for which each object can hold integers in the range 0 through 100. represent
Rationalnumber class a rational number is a number that can : rationalnumber class a rational number is a number that can be represented as the quotient of two nbspintegers. for
Over the past five years the state of south caledonia has : over the past five years the state of south caledonia has been afflicted by seven large epidemics of viral
The cost of building and maintaining an organizational : the cost of building and maintaining an organizational computing ecosystem has become a bigger part of most
Question 1-what sars viral proteins are made using the : question 1-what sars viral proteins are made using the frameshifting? nbspis there only one sars viral protein made

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to print the permutation

Write a program to print the permutation that lexicographically precedes the given input permutation.

  Write a method, to be included in a template unsorted list

Write a metho, to be included in a template unsorted list class, called replace_item, that will receive two xType parameters, one called olditem, the other called newitem.

  Make 2-dimensional array

make 2-dimensional array a bit of life and bringing them from the abstract to the concrete realms

  Make a game in which you guess a number

Make a game in which you guess a number between two set numbers to find the answer, the game should tell you if you are too low in your guess or too high. For example

  The two-dimensional array

1. Given the two-dimensional array declared by the following statement int myArray[4][3] = {{2,4,6},{1,8,10},{3,5,7},[9,11,13}}; what is the value of myArray[1][2]

  Demonstrate overriding of their getter and setter methods

Organize following animals using classes and virtual function. tigers,crocodile, elephants,pythons,zebras,hawks, chickens,rabbits using at least 3 properties some of the animals share. demonstrate overriding of their getter and setter methods.

  Write a program that will be used to gather statistical data

Write a program that will be used to gather statistical data about the number of movies

  Create a class called vehicle

Create a class called Vehicle that has the manufacturer's name (type String), number of cylinders in the engine (type int), and owner (type Person given below).

  Ohio phonebook has gotten mixed up

In an accident, the Ohio phonebook has gotten mixed up. The names are now really out of order. You and your enthusiastic, but naive, assistant Carl must fix the problem. No one can use the phonebook while you are sorting it, so every extra second of ..

  Write a sumo robot c program

Write a sumo robot c program for an aduino board, using 2 motors. 2 phototransistors and 2 Led sensors( sensors 2 for the front and 2 for the back ) which are going to be responsible for keping the robot in the sumo ring, making sure the robot com..

  Multiple heaps

Create an application that has two heaps. Place a linked list into each heap. Select one hundred random numbers. Place each of the random numbers into each heap - CSI 345 - Spring 2014 S2

  Implement database having array of pointers

One way to implement this database is to have an array of pointers pointing to Employee objects. You will obviously require a function named Calculate_salary() which will be different for each employee class. Write code in c++

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