write a pseudo code and then draw a flowchart to calculate tax deduction of employess salary >2000, tax is 7% and salary <2000, tax is 4%
Hmmmm.
enter salary
if salary greater than 2000, then go to high
go to low
end
High:
tax deduction=salary * .07
end
Low:
tax decuction= salary*.04
??? You write in FORTRAN II or something?
Ever hear of if-then-else ?
Plus, the problem is poorly worded. What to do if salary = 2000?
Sure! Here's a pseudo code to calculate tax deduction based on an employee's salary:
```
1. Read the employee's salary as input.
2. If the employee's salary is greater than or equal to 2000, do the following:
a. Calculate the tax deduction as 7% of the salary.
b. Display the tax deduction.
3. If the employee's salary is less than 2000, do the following:
a. Calculate the tax deduction as 4% of the salary.
b. Display the tax deduction.
4. End.
```
Now, let's draw the flowchart based on the pseudo code:
```
+-----------------------------------+
| Start |
+-----------------------------------+
|
V
+------------------+
| Read salary |
+------------------+
|
V
+------------------+
| Salary >= 2000 |
+------------------+
|
/ \
/ \
/ \
V V
+---+ +---+
| 7%| |4% |
+---+ +---+
| |
V V
+------------------+
| Display tax |
+------------------+
|
V
+-----------------------------------+
| End |
+-----------------------------------+
```
In this flowchart, the diamond shape represents a decision point (if statement), the rectangle represents an action, and the arrows represent the flow of control based on the conditions.