1.Do the planning and write an algorithm to solve the following problem. Prepare test data for the example to test all possibilities and draw a trace table.


Sam works at a coffee company where all the employees receive a bonus of R700, except the employees in the coffee department 3, who receive a bonus of R850. Enter his gross salary and his personal department number. Calculate the total income of Sam. Subtract 25% of the gross income for tax. Determine and display Sam’s net income on the screen

My Work:
CalcTotaincome
~ Calculate the total income
~ Input
display “ Sam’s gross income”, Salary ~ Display on new line
~ intermediate
display “Subtract gross income for tax”, tax ~ Display on new line
~ Processing
Totalincome = Gross income - (gross income * tax)
~ Test how much amount Sam receive as a netIncome
If salary = 700
~ Calculate if salary = R850
~ Output
display “Sam’s net income”, netIncome ~ Display on new line
end