Write an application to test class integerset, C/C++ Programming

Set of Integers) Create class IntegerSet. Each IntegerSet object can hold integers in the range 0-100. The set is represented by an array of bools. Array element a[i] is true if integer i is in the set. Array element a[j] is false if integer j is not in the set. The parameterless constructor initializes the array to the "empty set" (i.e., a set whose array representation contains allfalse values).
Provide the following methods:

a. Method Union creates a third set that is the set-theoretic union of two existing sets (i.e., an element of the third set's array is set to true if that element is true in either or both of the existing sets-otherwise, the element of the third set is set to false).

b. Method Intersection creates a third set which is the set-theoretic intersection of two existing sets (i.e., an element of the third set's array is set to false if that element is false in either or both of the existing sets-otherwise, the element of the third set is set to true).

c. Method InsertElement inserts a new integer k into a set (by setting a[k] to true).

d. Method DeleteElement deletes integer m (by setting a[m] to false).

e. Method ToString returns a string containing a set as a list of numbers separated by spaces. Include only those elements that are present in the set. Use --- to represent an empty set.

f. Method IsEqualTo determines whether two sets are equal.

Write an application to test class IntegerSet. Instantiate several IntegerSet objects. Test that all your methods work properly.

Posted Date: 3/29/2013 2:17:28 AM | Location : United States







Related Discussions:- Write an application to test class integerset, Assignment Help, Ask Question on Write an application to test class integerset, Get Answer, Expert's Help, Write an application to test class integerset Discussions

Write discussion on Write an application to test class integerset
Your posts are moderated
Related Questions
Enumerated Constants Enumerated constants enable the creation of new types and then explain variables of these types so that their values are restricted to a set of possible va

For Loop with inner loop

Problem 1. Explain Break and continue statements in C++. Explanation of Break statement Explanation of Continue statement 2. Explain concepts of constructors and

What is a newline escape sequence? - A newline escape sequence is signified by the \n character. - It is used to insert a new line whereas displaying the output data. - T

#question.Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two po

Describe problem with Runtime type identification? A: The run time kind identification comes at cost of performance penalty. Compiler maintains class.

A: It let you to provide an intuitive interface to users of your class, as well as makes it possible for templates to equally work well with classes and built-in/intrinsic types.

write c++ programm calculate electricity bill with person name,use ,id

For your class to work properly, you'll need to define appropriate constructors, extract and insert operators, and of course arithmetic operators. (If you wanted to use it as a gen

Write a program called Series that will print/display a series of numbers starting with 1 and ending with the last number that is less than 30. The series should include only odd n