help regarding java assignment
Can anyone help me regarding payroll assignment. His help will be highly
appreciated. I want help regarding the updation part of the problem. The
problem is as under :
Payroll case study
This case study provides practice in applying functional decomposition design
methods in a procedural programming context to a familiar file processing
The system consists of three programs performing the following functions
Data input - a program to prompt the user to enter monthly hours worked for
employees and storing the information provided in a data file. The input
data being :-
Employee number - an integer value.
Hours worked - as a whole number of hours.
Sort - a program to sort the data file into employee number order, producing
a new sorted data file.
Update - a program to update a master file containing employee information.
The file is organised in ascending order of employee number. The information
held on each employee is as follows :-
employee number - as above
rate of pay - in pounds/hour to 2 dec places.
tax free allowance - whole number of pounds per annum
tax deducted - year to date
gross income - year to date
The program takes a single command line parameter consisting of the month
number for which the data file applies and generates a new version of the
master file. It also outputs a report detailing :-
hours this month
gross pay this month
gross pay - year to date
tax due - year to date
tax previously deducted
tax due this month
net pay this month
The processing cycle goes as follows :-
A master file is created using a text editor - in practice this would be
done by a special programming which would allow new employees to be added
and existing ones to be changed or deleted.
employee data is entered and stored in a transaction file using the data
the resulting transaction file is sorted into employee number order using
the sort program creating a sorted transaction file.
the sorted transactions are applied to the old master file using the update
program, creating a new master file and a printout.
The algorithm for calculating tax liability here is simple. The tax liability
for month n is calculated as follows :-
Calculate gross income this period as hours_worked * rate_of_pay
Calculate gross_pay_year_to_date by adding income_this_period to previous
Calculate taxable_pay as gross_pay_year_to_date - tax_allowance * n / 12
Calculate tax_due as follows :-
If taxable_pay < basic_rate_limit * n / 12 then tax_due = taxable_pay * basic_rate
else tax_due = basic_rate * basic_rate_limit * n / 12 + (taxable_pay - basic_rate_limit
* n / 12) * higher_rate.
Calculate tax_due this month as tax_due - gross_tax_year_to_date
Update gross_pay_year_to_date and tax_paid_year_to_date to carry forward.
The basic and higher tax rates should be entered as percentages and the lower
rate limit as a whole number of pounds per annum. These three items should
be supplied from a data file.
The updation ans datainput program shold not involve arrays.