#include<iostream>
#include<string>
#define MAXnominees 3
using namespace std;
class MemberData
{
protected:
int ID ;
char Name[20];
char Add[20] ;
char Tel[15] ;
public:
void enterData();
void showData(void);
};
void MemberData::enterData() //allow user enter member's particular
{
cout << "Please enter your Membership number: " << endl;
cin >>ID;
cout << "Please enter your Name: "<< endl;
cin >>Name;
cout << "Please enter your Address: " << endl;
cin >>Add;
cout << "Please enter your Handphone number: " << endl;
cin >>Tel;
}
void MemberData::showData(void) //show member's particular
{
cout << "Member ID is: "<< ID<<endl;
cout << "Member Name is: "<<Name<<endl;
cout << "Member's Add is: "<<Add<<endl;
cout << "Member's Tel is: "<<Tel<<endl;
}
class NomineeData : public MemberData //Derived from class MemberData allow the user enter
//the nominees' particular
{
private:
int N_ID[20];
char N_Name[20];
public:
void N_enterData(int, char);
void N_showData(int, char);
};
void NomineeData::N_enterData(int N_ID, char N_Name)
{
cout << "Please enter Nominee's ID: "<< endl;
cin >> N_ID;
cout << "Please enter Nominee's Name: "<< endl;
cin >> N_Name;
}
void NomineeData::N_showData(int, char)
{
cout << "Nominee's ID is: "<< N_ID << endl;
cout << "Nominee's Name is: "<< N_Name << endl;
}
class Set_Nnum : public NomineeData //Derived from class MemberData to assign no to nominees
{
private:
char "James Tan", "Benny Koh", "Steven Lim", "David Tay", "Mary Tan";
public:
void Setname(void);
};
void Set_Nnum::Setname(void)
{
"James Tan" = 1;
"Benny Koh" = 2;
"Steven Lim" = 3;
"David Tay" = 4;
"Mary Tan" = 5;
}
int main()
{
MemberData showdata;
NomineeData N_showdata;
showdata.enterData;
showdata.showData();
N_showdata.N_enterData();
N_showdata.N_showData();
}
cnmsg007 0 Newbie Poster
elsiekins 0 Junior Poster
cnmsg007 0 Newbie Poster
cnmsg007 0 Newbie Poster
prvnkmr449 -8 Junior Poster
cnmsg007 0 Newbie Poster
Software guy 6 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.