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.

To solve the problem, we can follow these steps:

1. Ask the user to enter Sam's gross salary.
2. Ask the user to enter Sam's personal department number.
3. Check if the department number is 3:
- If it is, set the bonus amount to 850.
- If it is not, set the bonus amount to 700.
4. Calculate the total income by adding the gross salary and the bonus amount.
5. Calculate the tax by subtracting 25% of the total income.
6. Calculate the net income by subtracting the tax from the total income.
7. Display the net income on the screen.

Pseudocode for the algorithm:

```
1. Input Sam's gross salary.
2. Input Sam's personal department number.
3. If department number equals 3
Set bonus amount to 850.
Else
Set bonus amount to 700.
4. Set total income as gross salary + bonus amount.
5. Set tax as 25% of total income.
6. Set net income as total income - tax.
7. Display net income.
```

To prepare test data, you can choose different values for Sam's gross salary and department number. For example:

Test data:
- Gross salary: R5000
- Department number: 3

Trace table:

| Gross Salary | Department Number | Bonus Amount | Total Income | Tax | Net Income |
|--------------|-------------------|--------------|--------------|---------|------------|
| R5000 | 3 | R850 | R5850 | R1462.5 | R4387.50 |

It is important to note that in the trace table, the values for bonus amount, total income, tax, and net income are calculated based on the algorithm steps.