hello there, im new to C++ and i tried to design this code but the code is not running and i there is the code below
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <string>
using std::string;
using std::getline;
class staffMember{
public :
void setFirstName (string fname){
FirstName = fname; // stores the staff name in the object
}
string getFirstName(){
return fname;
}
void setLastName (string lname){
LastName = lname;
}
string getLastName(){
return = lname;
}
void setIdNo (string icno){
IdNo = icno;
}
string getIdNo(){
return icno;
}
void setNationality (string nationality){
Nationality = nationality;
}
string getNationality(){
return nationality;
}
void setReligion (string religion){
Religion = Religion;
}
string getReligion(){
return religion;
}
void setBirthDate ( string birthdate){
BirthDate = birthdate;
}
string getBirthDate(){
return birthdate;
}
int main ()
{
int staffNo;
string fname;
string lname
string icno;
string gender;
string birthdate;
string nationality;
string religion;
cout<<"Full Name: " <<endl;
getline( cin, name );
mystaffMember.setName( name );
cout<<"Identification Card Number: " <<endl;
getline( cin, icno );
mystaffMember.setIdNo( name );
cout<<"Gender: " <<endl;
getline( cin, gender );
mystaffMember.setGender( gender );
cout<<"Nationality: " <<endl;
getline( cin, nationality );
mystaffMember.setNationality( nationality);
cout<<"Religion: " <<endl;
getline( cin, religion );
mystaffMember.setReligion( religion );
cout<<"Date Of Birth: " <<endl;
getline( cin, birthdate );
mystaffMember.setBirthDate( birthdate );
}
void staffMember::genderAllocate()
{
//Validate gender
cout<<"Gender(Enter m for Male or f for Female):\n==>";
char g;
cin>>g;
if(g =='m'||g=='M'){
//m[emp].setgender ("MALE");
gender = "Male";
}
else if(g=='f'||g=='F'){
//m[emp].setgender("FEMALE");
gender = "Female";
}
else{
cout<<"Invalid!\n";
GenderAllocate();
}
}
void staffMember::religionAllocate()
{
//validate religion
cout<<("Religion:\n b->Buddhist\n c->Christian\n h->Hindu j->Jewish m->Muslim\n n->Non-Religious\n==>");
string r;
cin>>r;
if (r=="b"||r=="B")
religion=("Buddhist");
else if(r=="c"||r=="C")
religion=("Christian");
else if (r=="h"||r=="H")
religion=("Hindu");
else if (r=="j"||r=="J")
religion=("Jewish");
else if(r=="m"||r=="M")
religion=("Muslim");
else if(r=="n"||r=="N")
religion=("Non-Religious");
else
{
cout<<("Invalid!\n ");
religionAllocate();
}
}
}