-
Program help
My first C++ program and no idea where to begin. We are to design and implement
a Set class which should have these methods:
Set_Display -- list entire contents of set to screen
Set_Empty -- make a set empty of all members
Set_Intersection -- resultant set is elements in both sets
Set_Union -- resultant set is elements in either set
Set_Difference -- resultant set is element in first set but not in second
set
Set_Complement -- resultant set is set of elements not in original set
Overload these operators for objects of type set
* same as intersection
+ same as union
/ same as set difference
! complement set
To keep things simple, let's assume our Universal Set can be declared by the
instantiation of an object named UniverseSet and initialized to whatever
elements
are included in a string as:
Set UniversalSet("A,B,C,D,1,2,3,4,5,6,E,F,G,H");
all subsequent sets will be in terms of this UniversalSet.
-
That seems like a hard first program for you to have to write. Did you not pay attention in class at all?
[edit]
You should know how to create the class and the methods, don't you? This will show you how to do the overloading
http://www.cplusplus.com/doc/tutorial/tut4-2.html.
-
Your first C++ program and you're using classes?
Why don't you try doing your own homework and when you get stuck somewhere post the code you have so far (or at least the code that is giving you trouble) and we'll be glad to help.
So far all you've posted is the outline of your assignment and from the looks of things haven't attempted to write the first line of code for it, but you're asking someone here to do it for you.
-
figure out how to do what you want to do without writing code first. Then try to write the code. Then ask pertinent questions either about the underlying algorhythm or the code itself.
-
cool
I am looking for the end of this begining....