0% found this document useful (0 votes)
33 views3 pages

Employee Salary Calculation System

The document outlines the implementation of an Employee Salary Calculation System in Python, requiring the creation of an abstract class 'Employee' and its subclasses for different employee types. Each subclass, including Full-Time, Part-Time, and Intern, must implement methods to calculate salary, describe work, and return employee details. The program should ensure that no instance of the abstract class can be created directly and demonstrate the functionality through employee instances.

Uploaded by

saiyannsic20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views3 pages

Employee Salary Calculation System

The document outlines the implementation of an Employee Salary Calculation System in Python, requiring the creation of an abstract class 'Employee' and its subclasses for different employee types. Each subclass, including Full-Time, Part-Time, and Intern, must implement methods to calculate salary, describe work, and return employee details. The program should ensure that no instance of the abstract class can be created directly and demonstrate the functionality through employee instances.

Uploaded by

saiyannsic20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Employee Salary Calculation System

Objective:

In this assignment, you will implement a Python program to model different types of employees in a
company. The system should calculate salaries based on the employee type, with each type of
employee having a different salary structure.

Task Description:

You are required to create an abstract class named Employee, which will define common methods that
all employee types must implement. You will then create subclasses of Employee representing
different employee types, such as Full-Time Employees, Part-Time Employees, and Interns.

Each employee type should calculate their salary differently:

Full-Time Employees have a fixed salary.


Part-Time Employees are paid based on an hourly rate and the number of hours worked.
Interns receive a fixed stipend.

Instructions:

Define an abstract base class Employee that includes the following abstract methods:

calculate_salary(self): A method to calculate the employee's salary.


work(self): A method to describe the work done by the employee.
get_details(self): A method to return a description of the employee.

Create three subclasses of Employee:


FullTimeEmployee: It should have an attribute for the base salary. Implement the calculate_salary,
work, and get_details methods.
PartTimeEmployee: It should have attributes for the hourly rate and the number of hours worked.
Implement the calculate_salary, work, and get_details methods.
Intern: It should have an attribute for the stipend amount. Implement the calculate_salary, work, and
get_details methods.

Create Employee Instances and display their details, salary, and work.

Ensure that the program uses the abstract base class properly, and make sure no instance of
Employee can be created directly, as it is an abstract class.

Example Output:

Full-Time Employee: Alice, Base Salary: $60000

Salary: $60000

Alice is working full-time.

Part-Time Employee: Bob, Hourly Rate: $20, Hours Worked: 25

Salary: $500

Bob is working part-time.

Intern: Charlie, Stipend: $1000


Salary: $1000

Charlie is working as an intern.

Code Structure:

Abstract Class Employee:

Define the abstract methods calculate_salary, work, and get_details.

Subclasses (FullTimeEmployee, PartTimeEmployee, Intern):

Implement the abstract methods for each subclass based on the specifics of the employee type.

Create Employee Instances and display their details, salary, and work.

You might also like