Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- class Human {
- int age;
- string name;
- public:
- Human(int age, string name) {
- this->age = age;
- this->name = name;
- }
- string getName() {
- return name;
- }
- int getAge() {
- return age;
- }
- };
- class Employee{
- string company;
- int salary;
- public:
- Employee(string com, int sal) {
- this->company = com;
- this->salary = sal;
- }
- string getComp() {
- return company;
- }
- int getSal() {
- return salary;
- }
- };
- class Teacher : public Human, public Employee{
- string subject;
- public:
- Teacher(string sub,int age, string name,string com,int sal) : Human(age,name),Employee(com,sal){
- this->subject = sub;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment