Question: Write a Python program that will create a weekly payroll Working with Text Files The Payroll Department keeps a list of employee information for each
Write a Python program that will create a weekly payroll
Working with Text Files
The Payroll Department keeps a list of employee information for each pay period in an excel spreadsheet.
The data has been exported to a comma delimited text file called Employees.csv
Name, Hourly Rate, Hours,Has Health Insurance
Jim Ustad, Yes
Carol Lushbough,
Cynthia Anderson,
Jackie Brave,
Chris Brozel, Yes
Becky Smith,Yes
Nicholas Jackson,Yes
Dana Anderson,yes
Jeannette Baker,
A Recognize text
Shana Harms,
Jennifer Nicholes,
Joe Russell,Yes
Write a program that reports the weekly payroll. Your program should ask the user for the file name containing the names, hourly rate, hours worked and indication if they have health insurance. It should also ask the user for the benefits percentage broken down into SSN tax and health benefits. The benefits percentage is used to calculate the tax and heath care costs that are to be deducted from the gross pay. Health care benefits should not be deducted from those employees that do not have health insurance. Assume that overtime hours are any hours worked over and overtime rate is time and a half.
Your program should print to a text file, Payroll.txt a report of wages paid to the employees for the given period. This report should be in tabular format with the appropriate headers. Each line should contain an employees last name, first name, the number of hours worked, gross pay, benefits cost and net pay for that period.
Note:
to format monetary values you might want to convert them to a formatted string similar to the following:
netpaystring $:fformatnetpay
benefitsstring $:fformatbenefits
grosspaystring $:fformatgrosspay
to left justify string you could insert a dash before the number of columns something like:
payrollreport.writesslastname, firstname
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
