#include <iostream.h>
#include <conio.h>
#include <string.h>
class PassBook {
protected:
char PassBookId[6];
int age;
float balance;
char name[30];
public :
void PrintData()
{
cout<<name<<" is "<<age<<" "<<"yrs. old and he has a passbook. The identification of"<<endl;
cout<<"the pass book is "<<PassBookId<<" "<<"and the balance is "<<balance<<endl;
}
};
class Customer: public PassBook {
public:
void setCustomer(char n[],int a)
{
cout<<n;
strcpy(n,name);
age = a;
}
};
class AccountDetails: public PassBook {
public :
void setAccount(float bal){
balance = bal;
strcpy(PassBookId,"A1235F");
}
};
Customer cust;
AccountDetails custad;
int main()
{
clrscr();
cust.setCustomer("Mr. PeterWood Black", 34);
custad.setAccount(40000);
cust.PrintData();
getch();
return 0;
}
it wont return value passbookid
and balance
please help
tnx