Multiple inheritance,friend function and multiple file Task 1 Create Class Person with variables weight,height, gender. Create another Class Employee with variables designation, HoursPerDay. Now create another class Teacher and inherit it from Person and Employee and add function display() which should show all the details related to teacher. #include<iostream> #include<string> using namespace std; class Person{ int weight, height; string gender; public: Person() { weight = height = 0; gender = "0"; cout << "Default person" << endl; } }; class Employee{ string designation; int hourPerRate; public: Employee(){ designation = "0"; hourPerRate = 0;
Comments
Post a Comment