logo

Programming Assignment 1: Employee Payroll Register

   

Added on  2019-09-16

2 Pages567 Words244 Views
 | 
 | 
 | 
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.
Programming Assignment 1: Employee Payroll Register_1

End of preview

Want to access all the pages? Upload your documents or become a member.