Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python COSC 2436 Python Programming Assignment Payroll Classes - Inheritance and Polymorphism Specification: ABC Corp has a staff of employees and needs to calculate pay

Python
image text in transcribed
image text in transcribed
image text in transcribed
COSC 2436 Python Programming Assignment Payroll Classes - Inheritance and Polymorphism Specification: ABC Corp has a staff of employees and needs to calculate pay for all of its employees. Below is a class hierarchy of the employees Emplovee CommissionPaid Hourly Paid SalaryPaid Class Name: Employee - super class Members in the Employee class: All data fields are private members Data fields Data type Purpose name string Employee's name department string Employee's department Constructor Purpose init Parameter list: (names", department") Assign parameter value to data fields Method Name Return type Parameter list get name string Return data field name set name None Parameter list: (self, name) get_department string Return data field department set department None Parameter list: (self, department) pay float Return 0.0 str string Return the description of the Employee object Class Name: CommissionPaid - subclass of Employee Members in the Executive class: All data fields are private members Data fields Data type Purpose base rate float Base salary for the week sales float Weekly sales Constructor Purpose init call super class's_init_ Parameter list: (self, base_rate,sales) Assign parameter value to data fields Method Name Return type Parameter list get base rate float Return data field base_rate COSC 2436 Python Programming Assignment set base rate None Parameter list: (self, base_rate) get_sales float Return data field sales set sales None Parameter list: (self, sales) float Return base pay + commission for that week pay Commission calculation: if sales amount is greater than 30,000 commission is 3% of the sales amount else if sales amount is between 5,000 to 30,000 commission is 1% of the sales amount else (the sales amount is less than 5,000) there is no commission string Return the description of the CommissionPaid object Class Name: Hourly Paid - subclass of Employee Members in the Hourly Paid class: Data fields Data type Purpose hourly rate float Hourly rate hours float Hours worked for the week Constructor Purpose init call super class's _init_ Parameter list: (self, hourly rate, hours) Assign parameter value to data fields Method Name Return type Parameter list get_hourly rate float Return data field hourly rate set_hourly rate None Parameter list: (self, hourly rate) get_hours float Return data field hours set hours None Parameter list: (self, hours) pay float Calculate weekly pay including overtime pay Overtime pay calculation: If hours worked are over 40, the overtime pay will be calculated using hourly rate overtime hours 1.5 string Return description of the HourlyPaid object Class Name: Salarypaid-subclass of Employee str Members in the SalaryPald class: Data fields Data type salary float Purpose Weekly salary Constructor init Purpose call super class's_init Parameter list: (self, salary) 2 COSC 2436 Python Programming Assignment Assign parameter value to data field Method Name Return type Parameter list get salary float Return data field salary set salary None Parameter list: (self, salary) pay float return weekly salary str string Return description of the Salary Paid object Functions in the main program: Function Name Return Type Parameter List total pay float Parameter: a list of employee objects Return total weekly pay for all employees print_employee_list None Parameter: a list of employee objects Display the employee information. (See Program Output) Assignment Instructions: 1. Create a python module to store all classes and name it employees.py 2. Create a python file which will contain the main function to test your classes and name it assignment1_yourFirstName_yourLastName.py . To test your code, create a list of objects containing 3 instances. Summarize your data to display each employee information, and total payroll for the week. Here is the test data. Commissionpaid object: Justin white, Marketing department, base pay: seo, sales:550.000 Hourlypaid object: John Smith, Accounting department, hourly rate: 520.5 hours: ss. Salarypaid object: Mary Smith, Finance department, salary: $2,50 4. You can create extra function to enhance your program 5. Name your variables clearly 6. Add comments to document your project and code 7. Add doc string to document your module/functions 8. Submit two python files and a screen shot of your output in Canvas for grading Program Output: Employee Type Employee Name Department Weekly Pay Hourly Paid John Smith Accounting $ 1281.25 Salary Paid Mary Anith Finance Commission Paid Justin White Marketing 2000.00 Total Weekly pays $781.25 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

List the various effects of complement activation.

Answered: 1 week ago