C++ program to design a class for multiple inheritance
Design a class for multiple inheritance.
Click here to get other OOP Practical
FYIT practical 5-b Design a class to demonstrate multiple inheritance
#include<iostream>
using namespace std;
class person
{
protected:
int age;
char name[20];
public:
void get()
{
cout<<"Name : ";
cin>>name;
cout<<"Age : ";
cin>>age;
}
void disp()
{
cout<<endl<<"Person name : "<<name;
cout<<endl<<"Person age : "<<age;
}
};
class employee
{
protected:
float sal;
public:
void esal()
{
cout<<endl<<"Salary : ";
cin>>sal;
cout<<"Salary of the employee : "<<sal;
}
};
class empful:public person,public employee
{
protected:
float hours;
public:
void eworkhrs()
{
cout<<endl<<"Working hours : ";
cin>>hours;
}
void printhrs()
{
cout<<endl<<"Hours worked : "<<hours;
}
};
int main()
{
empful e;
e.get();
e.disp();
e.esal();
e.eworkhrs();
e.printhrs();
return 0;
}
Output

Check out more FYIT OOP Practical Program and other logic building programs in C++
FYIT OOP Practical Programs |
Classes and methods |
FY-1-a Design an employee class in easy way |
FY-1-b Design a student class in easy way |
FY-1-c Best OOP program to print factorial and other |
FY-1-d Best OOP program define function outside class |
Using friend functions. |
FY-2-a Best OOP program-friend function for adding the two complex numbers |
Constructors and method overloading |
FY-3-a Best C++ program to add two complex number |
FY-3-b Easy program to calculate area and volume using method overloading |
Operator Overloading |
FY-4-a Easy C++ program to overload unary operator (-) |
FY-4-b Overload the operator for adding the timings of two clocks in C++ in easy way |
FY-4-c Easy C++ program to overload the operator for concatenating two strings |
Inheritance |
FY-5-a Easy C++ program to design a class for single level inheritance |
FY-5-b Easy C++ program to design a class for multiple inheritance |
Other Practice-Program |
1 – Best C++ program to calculate employee salary |
More coming soon… Stay tuned |
We are aiming to explain all concepts of C++ and OOP in easiest terms as possible.

ITVoyagers
Author