You are required to produce a simplified payroll system for a fictional company. Each month a file is produced that contains the following information:
• Employee Name
• Employee National Insurance Number
• Grade 1 to 3
• (1=Staff, 2=Technical, 3=Manual)
• Hours worked
• Hourly pay rate
This file is attached as "employee.txt"
Your program will read in the data from the text file and process the data to produce a second file that contains:
• Employee Name
• National Insurance Number
• Gross Monthly Pay
• Monthly pension payment
• Monthly national insurance contribution
• Monthly income tax
• Total monthly net pay
Gross monthly pay is based on the hours worked and the rate of pay. Each employee has a standard 140-hour, calendar month. Staff grades do not have an enhanced overtime rate but technical employees have a 25% enhancement. Manual grades have a 50% enhancement for the first 40 hours overtime and a 100% enhancement for overtime above 40 hours.
Each employee pays a monthly pension equal to 7% of gross monthly pay, national insurance is payable at a rate of 8% on gross income after the pension contribution is removed.
All employees have a standard annual tax free allowance of £4, 800 after pension and national insurance have been deducted.
Tax is payable on any remaining income at the following annual national rates:
First £1, 750 @ 10%
Next £27, 250 @ 22%
Any remaining income over £29, 000 @ 40%
Your program will have a simple form containing one button to process the files. The contents of the file created must be shown in a textbox on the form.
In your code the location for the “employee.txt” file must be set to the a: drive (not c: or P and the file created must be called “payroll.txt” and written to the a: drive.
Some evidence of function decomposition is required to get a good mark.
Test Data
The correct output the for your program is shown below:
name NI_Number Gross_Pay Pension National_ins Tax Net_Pay
ALLEN A.B. YZ123456 £1,584.00 £110.88 £117.85 £192.66 £1,162.61
BALDWIN E.F. YZ234567 £1,974.40 £138.21 £146.90 £266.15 £1,423.15
CONWAY A. AC765432 £1,300.50 £91.04 £96.76 £139.30 £973.41
DAVIS V. AB564387 £2,106.61 £147.46 £156.73 £291.03 £1,511.39
EVANS Z. YG547285 £2,492.38 £174.47 £185.43 £363.64 £1,768.83
FORD F.N. YH529648 £1,319.30 £92.35 £98.16 £142.83 £985.96
GRIFFITHS N. AG439846 £2,144.80 £150.14 £159.57 £298.22 £1,536.87
HOBBS J. AB490190 £2,054.40 £143.81 £152.85 £281.20 £1,476.54
IMREY F. AJ396834 £1,312.50 £91.88 £97.65 £141.55 £981.42
JONES M. AK437645 £2,430.00 £170.10 £180.79 £351.90 £1,727.20
KNOWLES N. AJ374924 £1,526.22 £106.84 £113.55 £181.78 £1,124.05
LEWIS D. AK197843 £1,209.60 £84.67 £89.99 £122.19 £912.75
Last edited by 292530; Apr 26th, 2005 at 09:26 AM.