Problem Solving
1. Pseudocode
NIS_per = 0.025
NHT_per = 0.02
EdTax_per = 0.02
Threshold = 441168
Numb_Weeks = 52
Account_Count =0
Personnel_Count = 0
Loans_Count = 0
Teller_Count = 0
Operations_Count = 0
ThresholdWeekly_Amt = Threshold / Numb_Weeks
TotAccountGrossPay = 0
TotAccountNet_Pay =0
TotPersonnelGrossPay = 0
TotPersonnelNet_Pay = 0
TotLoansGrossPay = 0
TotalLoansNet_Pay = 0
TotTellerGrossPay = 0
TotTellerNet_Pay = 0
TotOperationsGrossPay = 0
TotOperationsNet_Pay
Read ID
While ID <> 0000 do,
read hours _worked, level, department
//Determine employee rate of pay base on the level
if level = 010 then
pay_rate = 625
Gross_Pay = pay_rate * hours_worked
NIS = Gross_Pay * NIS_per
NHT = Gross_Pay * NHT_per
Ed_Tax = (Gross_Pay - NIS) * EdTax_per
Net_Pay = Gross_Pay – NIS – NHT – Ed_Tax
PAYE = Gross_Pay – (Weekly_Amt + NIS)
TotAccountGrossPay += Gross_Pay
TotAccountNet_Pay += Net_Pay
Account_Count += 1
else if level = 020 then
pay_rate = 937.50
Gross_Pay = pay_rate * hours_worked
TotPersonnelGrossPay += Gross_Pay
Personnel_Count += 1
else if level = 021 then
pay_rate = 1000
Gross_Pay = pay_rate * hours_worked
NIS = Gross_Pay * NIS_per
NHT = Gross_Pay * NHT_per
Ed_Tax = (Gross_Pay - NIS) * EdTax_per
Net_Pay = Gross_Pay – NIS – NHT – Ed_Tax
PAYE = Gross_Pay – (Weekly_Amt + NIS)
TotLoansNetPay += Net_Pay
TotLoansGrossPay += Gross_Pay
Loans_Count += 1
else if level = 030 then
pay_rate = 1250
Gross_Pay = pay_rate * hours_worked
NIS = Gross_Pay * NIS_per
NHT = Gross_Pay * NHT_per
Ed_Tax = (Gross_Pay - NIS) * EdTax_per
Net_Pay = Gross_Pay – NIS – NHT – Ed_Tax
PAYE = Gross_Pay – (Weekly_Amt + NIS)
TotTellerNet_Pay += Net_Pay
TotTellerGrossPay += Gross_Pay
Teller_Count += 1
else if level = 031 then
pay_rate = 1250
Gross_Pay = pay_rate * hours_worked
NIS = Gross_Pay * NIS_per
NHT = Gross_Pay * NHT_per
Ed_Tax = (Gross_Pay - NIS) * EdTax_per
Net_Pay = Gross_Pay – NIS – NHT – Ed_Tax
PAYE = Gross_Pay – (Weekly_Amt + NIS)
TotOperationsNet_Pay += Net_Pay
TotOperationsGrossPay += Gross_Pay
Operations_Count += 1
endif
//print ID, hours worked, pay rate, department
Print “Id number :” ID
Print “Hours worked :”, hours_worked
Print “Pay rate :”, pay_rate
Print “Department :” department
// Print Gross pay, PAYE, NIS, NHT, ED Tax, net pay
Print “Gross Pay :”, Gross_Pay
Print “NIS:”, NIS
Print “NHT:”, NHT
Print “Education Tax :”, Ed_Tax
Print “Net pay :”, Net_Pay
Read ID
endwhile
// Print Summary
If(level == 010)
Print “Dapartment: “, department
Print “Number of Employee processed”, Account_Count
Print “Total Gross Pay:”, TotAccountGrossPay
Print “Total Net Pay :”, TotAccountNetPay
Endif
If(level == 020)
Print “Dapartment: “, department
Print “Number of Employee processed”, Personnel_Count
Print “Total Gross Pay:”, TotPersonnelGrossPay
Print “Total Net Pay :”, TotPersonnelNetPay
Endif
If(level == 021)
Print “Dapartment: “, department
Print “Number of Employee processed”, Loans_Count
Print “Total Gross Pay:”, TotLoansGrossPay
Print “Total Net Pay :”, TotLoansNetPay
Endif
If(level == 030)
Print “Dapartment: “, department
Print “Number of Employee processed”, Teller_Count
Print “Total Gross Pay:”, TotTellerGrossPay
Print “Total Net Pay :”, TotTellerNetPay
Endif
If(level == 031)
Print “Dapartment: “, department
Print “Number of Employee processed”, Operations_Count
Print “Total Gross Pay:”, TotOperationsGrossPay
Print “Total Net Pay :”, TotOperationsNetPay
Endif