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
A: A using declaration makes it possible to employ a name from a namespace without the scope operator.

Question 1 . Write a brief note on Aggregation Question 2 . Discuss briefly on constructors Question 3 . What are the important advantages of Inheritance? Question 4 .


Syntax rules for writing a destructor function Its name is the similar as that of the class to which it belongs, except that the first character of the name is the symbol t

The car’s measurements are illustrated, using two arrays. Array 1 = {L, R, L, R, R, L, R, R, L, R, R, L, R, L, L, R, Z}

What I need is an auto-click bot. The auto-click bot would ask me for a url(or it would be pre-defined too) so that it loads that specific url and click an ad automatically. This w

Write a ‘C’ program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

Aim: To implement a program to allocate memory dynamically for 2 dimensional array (accept and print matrix) using pointers. Code:                       #include #inc

I am seeking an expert to create a 360 degree virtual tour in KRPano for use on PCs, tablets and smartphones. You will be given with panoramas in order to create an advanced KRPano

A company needs 200 pencils per year . you cannot simply use this price as the cost of pencils two years from now. Because of inflation the cost is likely to be higher than it is