Question: Open - ended questions Define a class called Employee with attributes for name, age, and salary. Implement a method called get _ details that returns
Openended questions
Define a class called Employee with attributes for name, age, and salary. Implement a method called getdetails that returns a formatted string containing the employee's information.
Create a subclass called Manager that inherits from the Employee class. Add a new attribute department to the Manager class.
Override the getdetails method in the Manager class to include the department information.
Define a method called calculatebonus in the Employee class that returns a percentage of the employee's salary based on their age.
Define a method called promotetnmanager in the Employee class that promotes the employee to a manager with a specific department.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
