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 calculate Sam's total income, we'll need his gross salary and his personal department number.

Let's assume Sam's gross salary is G and his department number is D.

First, we'll calculate his bonus based on his department number:

If D is equal to 3 (coffee department), the bonus is R850.
For any other department, the bonus is R700.

So, Sam's bonus is determined by checking if his department number is 3 or not.

Once we have the bonus value, we can calculate Sam's total income by adding his gross salary and the bonus.

Total income = Gross salary + Bonus

Next, we need to calculate the tax from the total income. The tax is 25% of the gross income. We can find this value by multiplying the gross income by 0.25.

Tax = Total income * 0.25

Finally, we can calculate Sam's net income by subtracting the tax from the total income.

Net income = Total income - Tax

Now, let's assume Sam's gross salary is R5000 and his department number is 3.

Plugging these values into the formulas:

Bonus = R850 (since D = 3)
Total income = R5000 + R850 = R5850
Tax = R5850 * 0.25 = R1462.5
Net income = R5850 - R1462.5 = R4387.5

So, Sam's net income is R4387.5.

You can use the same set of calculations by substituting different values for the gross salary and department number to determine Sam's net income for different scenarios.