#include<conio.h>
#include<iostream.h>
#include<string.h>
class personnel
{
private:char name[20],addr[20],id[20];
int bdate;
public:void accept1();
void display1();
};
void personnel::accept1()
{
cout<<"\nenter name:-";
cin>>name;
cout<<"\nenter address:-";
cin>>addr;
cout<<"\nenter emaild id:-";
cin>>id;
cout<<"\nenter birth date:-";
cin>>bdate;
}
void personnel::display1()
{
cout<<"\nname:-"<<name
<<"\naddress:-"<<addr
<<"\nemail-ID:-"<<id
<<"\nbirth-date:-"<<bdate;
}
class academic
{
private:int mtn,mtw;
char cl[20];
public:void accept2();
void display2();
};
void academic::accept2()
{
cout<<"\nenter marks of tenth:-";
cin>>mtn;
cout<<"\nenter marks of twelth:-";
cin>>mtw;
cout<<"\nenter class:-";
cin>>cl;
}
void academic::display2()
{
cout<<"\ntenth marks:-"<<mtn
<<"\ntwelth marks:-"<<mtw
<<"\nclass:-"<<cl;
}
class bio_data:public personnel,academic
{
public:void accept3()
{
accept1();
accept2();
}
void display3()
{
display1();
display2();
}
};
int main()
{
bio_data b;
clrscr();
b.accept3();
b.display3();
getch();
return 0;
}
/*
enter name:-peer
enter address:-asdfg
enter emaild id:-pper
enter birth date:-434
enter marks of tenth:-668
enter marks of twelth:-444
enter class:-b
name:-peer
address:-asdfg
email-ID:-pper
birth-date:-434
tenth marks:-668
twelth marks:-444
class:-b
*/
#include<iostream.h>
#include<string.h>
class personnel
{
private:char name[20],addr[20],id[20];
int bdate;
public:void accept1();
void display1();
};
void personnel::accept1()
{
cout<<"\nenter name:-";
cin>>name;
cout<<"\nenter address:-";
cin>>addr;
cout<<"\nenter emaild id:-";
cin>>id;
cout<<"\nenter birth date:-";
cin>>bdate;
}
void personnel::display1()
{
cout<<"\nname:-"<<name
<<"\naddress:-"<<addr
<<"\nemail-ID:-"<<id
<<"\nbirth-date:-"<<bdate;
}
class academic
{
private:int mtn,mtw;
char cl[20];
public:void accept2();
void display2();
};
void academic::accept2()
{
cout<<"\nenter marks of tenth:-";
cin>>mtn;
cout<<"\nenter marks of twelth:-";
cin>>mtw;
cout<<"\nenter class:-";
cin>>cl;
}
void academic::display2()
{
cout<<"\ntenth marks:-"<<mtn
<<"\ntwelth marks:-"<<mtw
<<"\nclass:-"<<cl;
}
class bio_data:public personnel,academic
{
public:void accept3()
{
accept1();
accept2();
}
void display3()
{
display1();
display2();
}
};
int main()
{
bio_data b;
clrscr();
b.accept3();
b.display3();
getch();
return 0;
}
/*
enter name:-peer
enter address:-asdfg
enter emaild id:-pper
enter birth date:-434
enter marks of tenth:-668
enter marks of twelth:-444
enter class:-b
name:-peer
address:-asdfg
email-ID:-pper
birth-date:-434
tenth marks:-668
twelth marks:-444
class:-b
*/
No comments:
Post a Comment