There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram restart router screen slow sound trojan usb virus vista vista 32-bit windows windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Need help with assignment


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
weezer562's Avatar
Member with 34 posts.
 
Join Date: Jul 2004
Experience: Intermediate
29-Jan-2005, 09:21 PM #1
Question Need help with assignment
well the assignment is to develop an abstract type for handling characters. Only handling 26 capital letters. I have this need help with CharSet.cc

//CharSet.h

class CharSet
{
private:
bool Contents [26];

public:
CharSet(); //constructor initializes set to be empty

void Add(char Value); //add character to set corresponding bool set to
true
void Remove(char Value); //Removes char corresponding set to true

void Union(CharSet ASet); //Union the set passed a parameter into set

void Intersect(CharSet ASet); //Intersects set passed a parameter
contains results of intersection
bool Member(char Value) const;
}//end class CharSet

Also have testSet.h which is my test

#include "Charset.h"
#include <iostream>
using namespace std;
void printSet(CharSet ASet)
{
for (char c = 'A' ; c <= 'Z' ; c++)
{
if (ASet.Member (c))
{
cout << c;
}; //end if
}; //end for
cout << endl;
}; //end printSet
int main()
{
CharSet Set1;
CharSet Set2;
CharSet Set3;

Set1.Add('A');
Set1.Add('B');
Set1.Add('C');
Set2.Add('B');
Set2.Add('C');
Set2.Add('D');
Set3.Add('A');
Set3.Add('B');
Set3.Add('C');

Set1.Intersect(Set2);
Set3.Union(Set2);
Set2.Remove('C');
cout << "Expect BC" << endl;
printSet(Set1);
cout << "Expect ABCD" << endl;
printSet(Set3);
cout << "Expect BD" << endl;
printSet(Set2);
return 0;
}; //end main

thats what i have I really stuck on what to write in CharSet.cc and I was wondering if anyone could help me get started or anything. I can't even really think about how to set up the constructor and each function.

Any help would be appreciated.
Thanks
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:30 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.