Create a class named „Worker‟ having the following members: Sname, Sage, Sphone number ,Saddress, Ssalary.It also has a method named 'displaySalary' which displays the salary of the members. Two classes 'Employee' and 'Manager' inherit the „Worker‟ class. The 'Employee' and 'Manager' classes have data members 'Work specialization' and 'department' respectively. Now, assign name, age, phone number, address and salary to an employee and a manager by making an object of both of these classes and print the same.
-
Notifications
You must be signed in to change notification settings - Fork 0
Create a class named „Worker‟ having the following members: Sname, Sage, Sphone number ,Saddress, Ssalary.It also has a method named 'displaySalary' which displays the salary of the members. Two classes 'Employee' and 'Manager' inherit the „Worker‟ class. The 'Employee' and 'Manager' classes have data members 'Work specialization' and 'departmen…
Omkar3114/Inheritance
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Create a class named „Worker‟ having the following members: Sname, Sage, Sphone number ,Saddress, Ssalary.It also has a method named 'displaySalary' which displays the salary of the members. Two classes 'Employee' and 'Manager' inherit the „Worker‟ class. The 'Employee' and 'Manager' classes have data members 'Work specialization' and 'departmen…
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published