(Solved) : Exercise 2 Company Runs Small Factory Need Create Pay Slip Employees Company Details Java Q44028083 . . .
Exercise 2: A company runs a small factory. You need to create apay slip for the employees of the company. The details of the Javaapplication to be implemented is provided below.
A. The factory workers are paid one of the three hourly ratesdepending on their skill level.
Write a method to that takes the skill level as a parameterand returns the hourly rate. Use the switch construct in Java.
Skill Level Hourly Rate (dirham)
A 100 B 70 C 35
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 thegross pay depending on if there is overtime or not. Return thegross pay from the method.
C. Factory workers have extra benefits. Only workers in skilllevel A can choose to participate in the Retirement Plan at 5% oftheir gross pay. Also, The workers in all skill levels can chooseto participate in the following insurance options:
Option
1 2 3
Explanation
Medical Insurance Dental Insurance Disability Insurance
Weekly Cost to Employee (dirham)
150 95 65
Write a method that takes the worker’s skill level and grosspay as parameter and asks the user the necessary questions todecide on benefits (Insurance and/or Retirement). The user must begiven the choice to choose all three types of Insurances. Themethod must return the net pay after deducting the benefits if theworker chooses to obtain these benefits.
-
Ask the user to enter the details of all employees. The detailsinclude: Employee ID, Name, Skill level, and Working Hours per Weekshould entered in the main method. The Retirement and Insurancebenefits should be asked from the User in the above method.
-
Generate a pay slip for each employee i.e. if the user enters 10employees, then 10 pay slips are to be generated. Each pay slip iswritten 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 pay slip of the employee. The pay slip for eachworker must contain the following details in a neat and readableformat.
-
The ID, Name, and skill level of the Factory Worker
-
The total number of working hours of the factory worker
-
The hourly rate
-
The gross pay of a factory worker i.e. before thedeductions
-
The net pay i.e. Gross pay – Total deductions
-
using java programing language
-
Expert Answer
Answer to Exercise 2: A company runs a small factory. You need to create a pay slip for the employees of the company. The details …
OR