Good day,
I am trying to write a java program that will get info from a file named Employee.dat, the program should calculate the gross salaries of each of the Employee from the data in the file. It should then write the result to another file names Salary.dat.
Employee.dat is in this form
EMPLOYEE NAME GRADE LEVEL AGE BASIC SALARY
Juliet Ibrahim 6 32 34,000
Abbey George 8 46 60,000
Kayode Banjoko 9 53 74,000
Umoh Emeh 3 21 20,000
Salary.dat should be in this form
EMPLOYEE NAME GROSS SALARY
Juliet Ibrahim 45,000
Abbey George 70,000
In calculating the gross salaries(GS), the following allowances are to be added to the basic salary(BS):
1. If grade level is greater than 7, 10% of the BS is added to GS.
2. If age is greater than 50, 5% of BS is also added to GS.
I really do not have a problem with calculating the gross salaries, where I am having challenge is retrieving info. from Employee.dat file and being able to write the GS into the Salary.dat file.
If anyone can provide me with a link that solves a similar problem, I'd appreciate that too. This is not the full problem, but once I can get my hands on this I will be able to work on the broader problem.
Regards.
What I have tried:
I have a working program that does not incorporate the use of files.