
Pseudocode
algorithms
—
sequence, selection, repetition
c Solution algorithm
Process-Payroll-Earnings
Print 'PAYMENT SUMMARY' Heading
Print record type column headings (1,2,3,4,lnvalid)
Set Countl, Count2, Count3, Count4, Count-Invalid to zero
Set
Tot-Earnings1,
Tot-Eamings2, Tot-Earnings3, Tot-Earnings4
to zero
Read Payroll Record
DOWHILE not EOF
CASE OF record-code
1 : increment Countl
add earnings to Tot-Earnings1
2 : increment Count2
add earnings to Tot-Earnings2
3 : increment Count3
add earnings to Tot-Earnings3
4 : increment Count4
add earnings to Tot-Earnings4
other : increment Count-Invalid
ENDCASE
Read Payroll Record
ENDDO
Print Countl ...