Asked by Anonymous
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
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
Answers
There are no human answers yet.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.