A company runs a small factory. You need to create a payslip for the employees of the
Question:
A company runs a small factory. You need to create a payslip for the employees of the company. The details of the Java application to be implemented is provided below. A. The factory workers are paid one of the three-hourly rates depending on their skill level.
Write a method that takes the skill level as a parameter and returns the hourly rate. Use the switch construct in Java. B. Each factory worker might work any number of hours per week; any hour over 40 are paid at double rate.
Write a method that takes the hours worked and calculates the gross pay depending on if there is overtime or not. Return the gross pay from the method. Skill Level Hourly Rate (dirham) A 50 B 40 C 30 C. Factory workers have extra benefits. Only workers in skill level A can choose to participate in the Retirement Plan at 5% of their gross pay. Also, The workers in all skill levels can choose to participate in the following insurance options: Option Explanation Weekly Cost to Employee (dirham) 1 Medical Insurance 73 2 Dental Insurance 35 3 Disability Insurance 20
Write a method that takes the worker’s skill level and gross pay as a parameter and asks the user the necessary questions to decide on benefits (Insurance and/or Retirement). The user must be given the choice to choose all three types of Insurances. The method must return the net pay after deducting the benefits if the worker chooses to opt for these benefits. Ask the user to enter the details of all employees. The details include: Employee ID, Name, Skill level, and Hourly Pay should enter in the main method. The Retirement and Insurance benefits should be asked from the User in the above method. Generate a payslip for each employee i.e. if the user enters 10 employees, then 10 payslips are to be generated. Each payslip is written to a separate file with the name given as the employee id. For example: if the employee id is A11P9, then the file “A11P9.txt” will contain the payslip of the employee. The payslip for each worker must contain the following details in a neat and readable format.
The ID, Name, and skill level of the Factory Worker
The total number of working hours of the factory worker
The overtime hours
The hourly rate
The gross pay of a factory worker i.e. before the deductions
The total deductions i.e. the retirement and insurance benefits
The net pay i.e. Gross pay – Total deductions