Given is GROSS_PAY, draw a program plan, algorithm, and flowchart that will compute for DEDUCTIONS and NET_PAY for employee’s weekly Payroll. Consider the conditions:
If Civil Status = ‘SINGLE’
DEDUCTIONS = GROSS_PAY * 0.03
If Civil Status = ‘MARRIED’
DEDUCTIONS = GROSS_PAY * 0.06
If Civil Status = ‘WIDOW’
DEDUCTIONS = GROSS_PAY * 0.05
If Civil Status = HEAD OF THE FAMILY’
DEDUCTIONS = GROSS_PAY * 0.02
Using the formula:
[NET_PAY = GROSS_PAY – DEDUCTIONS]
Program Plan:
Available Input:
Civil Status
GROSS_PAY
Processing Requirements:
DEDUCTIONS = GROSS_PAY * TAX
NET_PAY = GROSS_PAY – DEDUCTIONS
Required Output:
NET_PAY
Algorithm:
START
Input:
'Civil Status'
GROSS_PAY
case 1: Civil Status = ‘SINGLE’
DEDUCTIONS = GROSS_PAY * 0.03
case 2: Civil Status = ‘SINGLE’
DEDUCTIONS = GROSS_PAY * 0.06
case 3: Civil Status = ‘SINGLE’
DEDUCTIONS = GROSS_PAY * 0.05
Output: NET_PAY = GROSS_PAY – DEDUCTIONS
case 4: Civil Status = ‘SINGLE’
DEDUCTIONS = GROSS_PAY * 0.02
Output:
NET_PAY = GROSS_PAY – DEDUCTIONS
STOP
Comments
Leave a comment