#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
Recommended Answers
Jump to PostSo what are the errors that you have ?
Jump to PostLooks Like this code is not yours or you don't have a clue about it, because you cannot spot simple mistakes, the errors are guiding you to your mistakes.
You have some problems in the declaration of enum
and then the two function the compiler is highlighting both of …
All 6 Replies
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.