Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How can I make a program in Python using files and exceptions to process payroll for all hourly paid employees? The program should allow me

How can I make a program in Python using files and exceptions to process payroll for all hourly paid employees? The program should allow me to enter each employee's ID, name, hours worked, and hourly pay rate. It should calculate gross pay with overtime hours (beyond 40 h) that are paid 50% more. The program should display total number of employees, total number of hours worked by all employees, and a total gross pay and save them at the end into a text file and make a backup file.

The program should contain the following functions: main(), get_employee_info(), calc_gross_pay(hours, rate), display_pay_statement(emp_id, emp_name, hours_horked, hourly_pay_rate, gross_pay), save_pay_statement_to_file(file_object, emp_id, emp_name, hours_worked, hourly_pay_rate, gross_pay), save_summary_to_file(file_object, number_of_employees, total_hours_worked, total_gross_pay).

Note: The get_employee_info() should return employee id, name, hours worked, and hourly pay rate.You may name the text file and backup file yourself in the main function.

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

Step: 3

blur-text-image

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Briefly describe vegetative reproduction in plants.

Answered: 1 week ago

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago