May-10-2019, 06:55 AM
Create a script that reads in the attached emp.txt file and outputs a file with the net pay of each employee. Incorporate the overtime and net pay rules from the previous assignments. Also, create a separate file which states the employee with the highest net pay and the employee with the lowest net pay.
Emp.text file (https://docs.google.com/document/d/1bw6N...9uOuFYf0kg)
The structure of emp.txt is the following:
employee_id, hourly_rate, hours_worked, years_of_service
Overtime rules:
To earn overtime the employee must have worked for the company for at least 2 years AND must have worked over 40 hours
If the employee worked over 50 hours they receive an additional 50 to be added to grossPay
If the employee has worked over 40 hours but has not worked for the company for at least 2 years they do not receive overtime.
Use the following formula to determine how much overtime the user worked
overtime = <hours worked> - 40
Calculate the gross pay with the following formula
grossPay = (overtime * <hourly rate> * 2) + ((<hours worked> - overtime) * <hourly rate>)
Net Pay rules:
subtract 39% from gross pay
Emp.text file (https://docs.google.com/document/d/1bw6N...9uOuFYf0kg)
The structure of emp.txt is the following:
employee_id, hourly_rate, hours_worked, years_of_service
Overtime rules:
To earn overtime the employee must have worked for the company for at least 2 years AND must have worked over 40 hours
If the employee worked over 50 hours they receive an additional 50 to be added to grossPay
If the employee has worked over 40 hours but has not worked for the company for at least 2 years they do not receive overtime.
Use the following formula to determine how much overtime the user worked
overtime = <hours worked> - 40
Calculate the gross pay with the following formula
grossPay = (overtime * <hourly rate> * 2) + ((<hours worked> - overtime) * <hourly rate>)
Net Pay rules:
subtract 39% from gross pay