CS304 Assignment 02 Solution Idea 6

No Comments
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>

class Virtual_Ballot_Paper
{
private:
int NoOfsigns;
char *NameOfVotingCategory;
public:
Virtual_Ballot_Paper()
{
NoOfsigns = 0;
NameOfVotingCategory = NULL;
}

void DisplaySign();
~Virtual_Ballot_Paper(){}


};
class Candidate : public Virtual_Ballot_Paper
{
private:
char* Name;
char* Address;
char* CandidateType;
int NoVotes;
public:
Candidate()
{
Name = Address = CandidateType = NULL;
NoVotes = 0;
}
Candidate(char *n ,char *a ,char *c ,int x)
{
Name = n;
Address = a;
CandidateType = c;
NoVotes = x;

}
~Candidate(){}

};

class Sign : public Candidate
{
private:
char *Name;
public:
void Select();
~Sign()
{
}
};

class Constituency : public Candidate
{
private:
int NoOfCandidates;
int NoOfVoters;
int ConstituencyNo;
public:
Constituency()
{
NoOfCandidates = 0;
NoOfVoters = 0;
ConstituencyNo = 0;
}
Constituency(int n ,int x ,int c)
{
NoOfCandidates = n;
NoOfVoters = x;
ConstituencyNo = c;
}
int GetConstituencyNo();
~Constituency(){}
};
class Result : public Virtual_Ballot_Paper
{
public:
int CountVotes();
int AnnounceResult();
~Result(){}
};

main()
{
Result r;
int getch();
}

Next PostNewer Post Previous PostOlder Post Home

0 comments

Post a Comment