Answered step by step
Verified Expert Solution
Link Copied!

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:


image

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java How To Program Late Objects Version

Authors: Paul Deitel, Deitel & Associates

8th Edition

0136123716, 9780136123712

More Books

Students also viewed these Programming questions

Question

Explain the importance of Human Resource Management

Answered: 1 week ago

Question

Discuss the scope of Human Resource Management

Answered: 1 week ago

Question

Discuss the different types of leadership

Answered: 1 week ago

Question

Write a note on Organisation manuals

Answered: 1 week ago