Plzzzzzzzzzzzz tell me whats the problem in this programme
Its very urgent..........
# include <iostream>
# include <iomanip>
# include <string>
# include <conio.h>
# include <stdio.h>
using namespace std;
class security
{
protected:
string user_ID;
string Password;
public:
security()
{
}
security(string username,string ID)
{
user_ID=username;
Password=ID;
}
virtual void getdata()
{
cout<<"Enter the following information to log in.";
cout<<setw(78)<<"User ID: ";
class gate:public security
{
private:
int gate_num;
public:
void getdata()
{
cout<<"\nFor which gate you want to enter data.";
cin>>gate_num;
}
};
class record:public security
{
private:
string NIC_num;
string car_num;
char reg_status,res_status;
char house_typ;
int house_num;
char pch;
public:
record()
{}
record(int regstatus,string carnum,string Nic,int housenum,int resstatus,char housetyp)
{
NIC_num=Nic;
car_num=carnum;
reg_status=regstatus;
res_status=resstatus;
house_typ=housetyp;
house_num=housenum;
}
void getdata()
{
cout<<"\n*********************************Welcome Mr."<<user_ID<<" ***********************************";
cout<<"Is it registered? R(Registered) / N(Non-registered): ";
cin>>reg_status;
if (reg_status=='N')
cout<<"Non-Registered";
else if (reg_status=='R')
{
cout<<"Registered";
cout<<"\nEnter car #: ";
getline(cin,car_num,'.');
}
cout<<"\nIs the driver Resident? R(Resident) / N(Non-resident): ";
cin>>res_status;
if (res_status=='R')
cout<<"Resident";
else if (res_status=='N')
{
cout<<"Non-Resident";
cout<<"\nEnter 14 digit NIC number of the driver: ";
getline(cin,NIC_num,'.');
}
cout<<"\nEnter the Destination B(Banglow) / F(Flat): ";
cin>>house_typ;
{
if (house_typ=='B')
cout<<"Banglow";
else if (house_typ=='F')
cout<<"Flat";
}
cout<<"\nEnter "<<house_typ<<" #: ";
cin>>house_num;
}
void showdata()
{
cout<<"\nRegistration:"<<reg_status;
if(reg_status=='R')
{
cout<<"\nCar #: "<<car_num;
}
cout<<"\nResidence:"<<res_status;
if (res_status=='N')
{
cout<<"\nNIC #: "<<NIC_num;
}
cout<<"\nDestination: "<<house_typ<<" "<<house_num;
}
};
void main()
{
security *S;
gate G;
record R;
cout<<"\nPress A to log in to your account. ";
cout<<"\nPress B to Enter gate number. ";
cout<<"\nPress C to enter the data. ";
cout<<"\nPress D to show records. ";
char dec,opt;
do{
cout<<"\nChoose an option:";
cin>>dec;
switch (dec)
{
case 'A':
S->getdata();
cout<<"\nLogged in..... ";
break;
case 'B':
S=&G;
S->getdata();
break;
case 'C':
S=&R;
S->getdata();
break;
case 'D':
R.showdata();
break;
default:exit(0);
}
cout<<"\nDo you want to log off? Y/N: ";
cin>>opt;
if (opt=='Y')
{
cout<<"Logged off....\n";
}
}while (opt!='Y');
}