Skip to content

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…

Notifications You must be signed in to change notification settings

Omkar3114/Inheritance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inheritance

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.

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

No packages published