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, 15,50,Yes
Carol Lushbough,20,47.5,
Cynthia Anderson,12,40,
Jackie Brave, 12,40,
Chris Brozel, 22,40,Yes
Becky Smith,24,50,Yes
Nicholas Jackson,25,60,Yes
Dana Anderson,15,45,yes
Jeannette Baker,15,40,
A Recognize text
Shana Harms,13,25,
Jennifer Nicholes,12,35,
Joe Russell,16,40,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 40 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:
net_pay_string ="${:,.2f}".format(net_pay)
benefits_string ="${:,.2f}".format(benefits)
gross_pay_string ="${:,.2f}".format(gross_pay)
2.
to left justify string you could insert a -(dash) before the number of columns something like:
payroll_report.write("%-15s%-10s"%(last_name, first_name))
Write a Python program that will create a weekly

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!