Question: set _ base _ pay None Assign parameter value to base _ pay get _ sales float Return data field sales set _ sales None

set_base_pay None Assign parameter value to base_pay
get_sales float Return data field sales
set_sales None Assign parameter value to sales
pay
float Return base pay + commission for that week
Commission calculation:
If the sales amount is greater than $8,000
commission is 3% of the sales amount
if the sales amount is between $3,000 to $8,000(inclusive)
commission is 1.5% of the sales amount
if the sales amount is less than $3,000
there is no commission
__str__ string Return the description of the CommissionPaid object
Class Name: HourlyPaid Subclass of Employee
Members in the HourlyPaid class: *All data fields are private members
Data fields Data type Purpose
hourly_rate float Hourly rate
Hours_worked float Hours worked for the week
Constructor Purpose
__init__ Parameter list: (self, name, department, hourly_rate,
hours_worked)
Call super classs __init__() method
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 Assign parameter value to hourly_rate
get_hours_worked float Return data field hours_worked
set_hours_worked None Assign parameter value to hours_worked
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.75
__str__ string Return description of the HourlyPaid 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)
main() None 1. Create 2 CommissionPaid objects
COSC 1437 Python Programming Assignment 2
3
2. Create 2 HourlyPaid objects
3. Create a list of Employee objects and add those objects
you created into the list
4. Call total_pay() to get total weekly pay
5. Call print_employee_list to display all objects
Assignment Instructions:
1. Create a python file to store all classes and name it employees.py
2. Create a python file which contains the main program to test your classes and name it
payroll_yourLastName_yourFirstName.py.(Make sure to import your class file in this file.)
3. Add comments on top of your program to document your code. Include Program description,
your name and date.
4. Create the required structures for the classes described above. Make sure to follow the
method/function name, return type and parameter list as described.
5. You can create extra methods/functions to enhance your program, but make sure to create the
required methods/functions first before adding any helper functions.
6. Use the following data to test your code.
CommissionPaid object: Fname1 Lname1, Finance, base pay: $500, sales: $15,000
CommissionPaid object: Fname2 Lname2, Sales, base pay: $1000, sales: $8,000
HourlyPaid object: Fname3 Lname3, Accounting, hourly rate: $20.5, hours: 60.0
HourlyPaid object: Fname4 Lname4, Marketing, hourly rate: $35, hours: 30.0
7. Summarize your data to display each employee information, and total payroll for the week. See
program output below
Program Output:
Employee Type Employee Name Department Weekly Pay
-----------------------------------------------------------------
Commission Paid Fname1 Lname1 Finance 950.00
Commission Paid Fname2 Lname2 Sales 1120.00
Hourly Paid Fname3 Lname3 Accounting 1537.50
Hourly Paid Fname4 Lname4 Marketing 1050.00
Total Pay for the Week: $4657.50

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!