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
there is a pebble merchant. he sells the pebbles,that are used for shining the floor.his main duty is to take the length of the room side but he sometines mistakes doing that and m

How many levels deep can include files be nested? - As such, there is no limit to number of levels of nested include files you can have however your compiler might run out of s

Program to store family members details in C++: #include #include #include struct record {   char name[30];   int age;   char state[40]; }x; //cal

Comments Comments are integral part of every program . Comments help in coding, debugging and maintaining a program . The compiler ignores them. They should be used liberally i

Q: In p = new Fred(), does the Fred memory "leak" if  Fred constructor throws an exception? A: No.         If an exception take place during the Fred constructor of p = new F

Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Question 1. Explain Briefly about class and objects. 2. Create a class string which stores a string value. Overload ++ operator which converts the characters of the string t

There are ''n'' ants on a ''n+1'' length rod. The ants are numbered from 1 to n and are initially placed at positions starting from position 1 till position n. They are moving eith

THIS PROGRAM IS TO ADD TWO DISTANCES & SHOW THEIR SUM AS NEW DISTANCE # include # include typedef int dist; struct distance   {   dist inch;   dist feet;   }; distance add