Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python code for the payroll system of Employees in a company as follows: The program should have 4 classes: 1- Employee class:
Write a Python code for the payroll system of Employees in a company as follows: The program should have 4 classes: 1- Employee class: 5 points Use init () for initializing the attributes of the class: name, id Define a method gross_pay(): it does nothing in this class Overload the method str both name and id must be printed (), format the information of the employee as you like.. 2- SalariedEmployee class: for employees who are paid a monthly salary only It inherits the Employee class Use init () for initializing the attributes of the class: name, id, salary O Note: The initialization of name and id should be used from the super class Define a method gross_pay(): it returns the salary of an employee Overload the method str (), format the information of the employee as you like.. name, id and salary must be printed 3- Commission Employee class: for employees who are paid based on a commission rate of their sales It inherits the Employee class Use init () for initializing the attributes of the class: name, id, com_rate, sales O Note: The initialization of name and id should be used from the super class Define a method gross_pay(): it returns the amount that the employee is paid: rate*sales Overload the method str (), format the information of the employee as you like.. name, id, com_rate, sales must be printed 4- Salaried Commission Employee class: for employees who are paid a monthly salary and also a rate of their sales It inherits the Commission Employee class Use init () for initializing the attributes of the class: name, id, com_rate, sales, salary o Note: The initialization of name,id, com_rate and sales should be used from the super class Define a method gross_pay(): it returns the amount that the employee is paid, which is salary+ the gross_pay of the super class Overload the method str (), format the information of the employee as you like.. name, id, com_rate,sales, and salary must be printed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres the Python code for the payroll system with the required classes and methods class Employee de...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started