The register should contain the following data: o Employee number (print left-justified) o Department o Pay Rate o Exempt Status o Hours Worked o Base Pay ( base pay = pay rate * hours worked (up to 40 hours)) o Overtime Pay (only calculated for non-exempt employees, time-and- a-half for all hours worked over 40). Your main function should print the report and column headings into the output file, then enter a loop
| 2 pages
| 567 words
| 488 views
Trusted by 2+ million users, 1000+ happy students everyday
Showing pages 1 to 1 of 2 pages
Computer Science 1Programming Assignment 6Functions & File I/O60 PointsThe data shown below is stored in a file named emp_data.txt. A copy of the data file is in D2L under Content for Unit 6. The data is stored with no column headings, a space between each data item and a return after the hours data for each employee.Employee #Dept.Pay RateExemptHours205147.54N4534986417.98Y3813283825.75Y4990547610.43N42213648.29N47659147.52N4154871425.75Y524326387.54N361267768.29N40Write a program to read the employee file and create a payroll register. Store the payroll register into a file named emp_pay.txt. The register should contain the following data:oEmployee number (print left-justified)oDepartment oPay Rate oExempt StatusoHours WorkedoBase Pay ( base pay = pay rate * hours worked (up to 40 hours))oOvertime Pay (only calculated for non-exempt employees, time-and-a-half for all hours worked over 40).oTotal payYour report should be printed in column format with a title and the message “End of Report” at the end.You should have separate functions to:oRead a line of data.oCalculate the Base Pay, Overtime pay, and Total pay for one employee.oPrint one line in the report.Your program should work with files containing fewer or more records (lines) than those shown in the table above.
Found this document preview useful?
You are reading a preview Upload your documents to download or Become a Desklib member to get accesss