Question: set _ base _ pay None Assign parameter value to base _ pay get _ sales float Return data field sales set _ sales None
setbasepay None Assign parameter value to basepay
getsales float Return data field sales
setsales None Assign parameter value to sales
pay
float Return base pay commission for that week
Commission calculation:
If the sales amount is greater than $
commission is of the sales amount
if the sales amount is between $ to $inclusive
commission is of the sales amount
if the sales amount is less than $
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
hourlyrate float Hourly rate
Hoursworked float Hours worked for the week
Constructor Purpose
init Parameter list: self name, department, hourlyrate,
hoursworked
Call super classs init method
Assign parameter value to data fields
Method Name Return type Parameter list
gethourlyrate float Return data field hourlyrate
sethourlyrate None Assign parameter value to hourlyrate
gethoursworked float Return data field hoursworked
sethoursworked None Assign parameter value to hoursworked
pay float Calculate weekly pay including overtime pay
Overtime pay calculation:
If hours worked are over the overtime pay will be
calculated using hourly rate overtime hours
str string Return description of the HourlyPaid object
Functions in the main program:
Function Name Return Type Parameter List
totalpay float Parameter: a list of employee objects
Return total weekly pay for all employees
printemployeelist None Parameter: a list of employee objects
Display the employee information. See Program Output
main None Create CommissionPaid objects
COSC Python Programming Assignment
Create HourlyPaid objects
Create a list of Employee objects and add those objects
you created into the list
Call totalpay to get total weekly pay
Call printemployeelist to display all objects
Assignment Instructions:
Create a python file to store all classes and name it employees.py
Create a python file which contains the main program to test your classes and name it
payrollyourLastNameyourFirstName.pyMake sure to import your class file in this file.
Add comments on top of your program to document your code. Include Program description,
your name and date.
Create the required structures for the classes described above. Make sure to follow the
methodfunction name, return type and parameter list as described.
You can create extra methodsfunctions to enhance your program, but make sure to create the
required methodsfunctions first before adding any helper functions.
Use the following data to test your code.
CommissionPaid object: Fname Lname Finance, base pay: $ sales: $
CommissionPaid object: Fname Lname Sales, base pay: $ sales: $
HourlyPaid object: Fname Lname Accounting, hourly rate: $ hours:
HourlyPaid object: Fname Lname Marketing, hourly rate: $ hours:
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 Fname Lname Finance
Commission Paid Fname Lname Sales
Hourly Paid Fname Lname Accounting
Hourly Paid Fname Lname Marketing
Total Pay for the Week: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
