0

Can u just explain me how to understand this cpp program's logic

multiple inheritance: program to create personal information which includes name address and gender as the data members another class for physical information with data members height weight blood group .derive a class called salary with employee number department and salary.find increment in salary for an employee if(S-SALES..P-PURCHASE) for male in dept- S or P-10% FOR female in dept -S OR P-11%

30th Mar 2018, 4:48 AM
Deepanshu Sharma
Deepanshu Sharma - avatar
1 Answer
0
See Multiple Inheritance is simple! It's like a Boss of a Company accessing the Employees. Here all the employees are treated as Base Class & they are Derived at Boss Class. It will be more helpful to people if you upload the program. I think according your program "Personal Information" & "Physical Information" are treated as Base classes & "Salary" will treated as Derive Class. So, in main() function you just have to declare a class type variable of class "Salary" by which you will able to access the data members of the Base Classes! Check This out, It will help you to Understand... https://code.sololearn.com/cjggN4JxJtMq/#cpp
31st May 2018, 8:44 AM
Surajit
Surajit - avatar