Question: Exercise #4: Write a Java program which reads the input from a file and calculates and prints the monthly paycheck for an employee to a
Exercise #4: Write a Java program which reads the input from a file and calculates and prints the monthly paycheck for an employee to a file or files. The program depends on the number of lines in the input file, one ouput file per line in input file. In other words, for multiple employees, the program will result in multiple files given multiple input salaries in the input file.
For net salary, the following deductions and additions are required during calculation step:
| Deducations: | Additions: |
| Retirement Plan: 5% Health Insurance: 750 AED | Housing Allowence: 20% Transportation Allowence: 200 |
Your Java program should read the input gross amount from input file. The format for input and output file should be like this:
Input File Sample: | Output File Sample: |
10000 | Gross Amount: 10000.00 ************************************** Retirement Plan: - 500.00 AED Health Insurance: - 750.00 AED Housing Allowence: + 2000.00 AED Transportation Allowence: + 200.00 AED ************************************** Net Salary: 10950.00 AED |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
