Algorithm Development2
Algorithm Development2
Algorithm Development
Write an algorithm to calculate the salary and Incentive for all 25 Staff Members. The
algorithm should record the Employee Number, Name Department, Regular Pay and
Overtime pay for each employee. It should then calculate the Gross Pay, Gross Pay =
(Regular + Overtime). The algorithm should then calculate the amount for each employee
deductions. Deductions are as follows:
Income Tax 25 %
Edu Tax 2%
NHT 3%
NIS 2%
The algorithm should calculate and output the total Deduction and the Net Pay, Net Pay =
Gross Pay- Deductions.
If the employee is a Member of the Sales Team, the algorithm should ask for a Performance
Rating. If the Performance Rating is over 50 % the Salesperson should get an Incentive of
15% of their Gross Salary.
The algorithm should output the Employee Number Name, Gross salary, deductions, Total
deductions, Net Pay and Incentive if applicable.
Programming
Write a program to represent the algorithm above. Ensure that the program is
properly documented with a Problem definition, Author Name, Date Created,
comments, spaces, etc.
Trace Table
Create a Trace Table; use Test Data for at least five employees to test the program.
The test data should check for Sales persons whose Performance Rating is above or
below 50%
1
SBASheet
START
INCOME_TAX = 0.25;
EDU_TAX = 0.02;
NHT = 0.03;
NIS = 0.02;
INCENTIVE_RATE = 0.15;
I=0
WHILE i<25 DO
READ EmployeeNumber
READ FirstName
READ LastName
READ Department
READ RegularPay
READ Overtime
TotalDeduction=Deduction
NetPay=GrossPay- TotalDeduction
2
SBASheet
If Department==”Sales” THEN
READ Rating
IF Rating>50 THEN
Incentive=GrossSalary*.15
ENDIF
ENDIF
IF Rating>.50 THEN
PRINT Incentive
ENDIF
ENDFOR
STOP
3
SBASheet