Thread: Program help

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    7

    Angry 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.

  2. #2
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326
    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.
    Last edited by JoshG; 06-04-2002 at 08:44 AM.

  3. #3
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    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.

  4. #4
    Unregistered
    Guest
    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.

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    249

    Wink cool

    I am looking for the end of this begining....
    C++
    The best

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM