0% found this document useful (0 votes)
11 views

Krishnal 4

Oops concepts

Uploaded by

demonkingts1989
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Krishnal 4

Oops concepts

Uploaded by

demonkingts1989
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Name : Krishnal Choudhary

Class : SE
Batch : A1
Roll No : 20
Assignment No : 6

#include<iostream>
using namespace std;

class Personal {
protected:
string name,address,dob,emailid;
long int numb;
public:
Personal(); //default constructor.
void getdata();
};

Personal::Personal() {
name=address=dob=emailid=" NULL";
numb=0;
}

void Personal::getdata() {
cout<<"\nEnter Name:\t";
cin>>name;
cout<<"\nEnter Address:\t";
cin>>address;
cout<<"\nEnter Date of Birth:\t";
cin>>dob;
cout<<"\nEnter Email Id:\t";
cin>>emailid;
cout<<"\nEnter Phone Number:\t";
cin>>numb;
}

class Professional {
protected:
int experience,salary_expected;
public:
Professional();
void getdata();
};

Professional::Professional()
{
experience=salary_expected=0;
}

void Professional::getdata() {
cout<<"\nEnter Years of Experience:\t";
cin>>experience;
cout<<"\nEnter Salary Expected:\t";
cin>>salary_expected;
}

class Academic {
protected:
float percent,sgpa;
int grad;
public:
Academic();
void getdata();
};

Academic::Academic() {
percent=sgpa=0.0;
grad=0;
}

void Academic::getdata() {
cout<<"\nEnter 12th Percentage:\t";
cin>>percent;
cout<<"\nEnter Sgpa:\t";
cin>>sgpa;
cout<<"\nEnter Year of Graduation:\t";
cin>>grad;
}

class bio_data: public Personal ,public Professional, public Academic {


public:
void display();
};

void bio_data::display() {
cout<<"\n**********************************************\n";
cout<<"\n\t\t\tEMPLOYEE BIO_DATA\n";
cout<<"\nName:\t"<<name;
cout<<"\nAddress:\t"<<address;
cout<<"\nDate of Birth:\t"<<dob;
cout<<"\nEmail Id:\t"<<emailid;
cout<<"\nPhone Number:\t"<<numb;
cout<< "\nYears of experience:\t"<<experience;
cout<<"\nSalary Expected:\tRps "<<salary_expected;
cout<< "\n12th Percentage:\t"<<percent;
cout<<"%\nSgpa:\t"<<sgpa;
cout<<"%\nYear of Graduation:\t"<<grad<<"\n";
}

int main() {
bio_data obj;
obj.Personal::getdata();
obj.Professional::getdata();
obj.Academic::getdata();
obj.display();

return 0;
}
---------------------------------------------------Output------------------------------------------------

You might also like