You are on page 1of 6

Ex1.

Input: num1, num2


Input: operator
Case +: Output: num1+num2
Case -: Output num1–num2
Case *: Output num1*num2
Case /: Output num1/ num2

Num1, num2

If opertor

+ Num1 +Num2

- Num1-num2

* Num1*num2

/ Num1/num2
Ex2.
Processing: min=12
For all number in [12, 34, 9, 24, 39]:
If min>number
Processing: min = number
Output min

A=[12, 34, 9, 24, 39]

I=0, min=0

Min >number
Min

Min > number

Min = number

I<5
I

Min

Ex.3
Sum=0
Do:
Input: num
Sum += num
While num != 0

Num

Sum += num

!=0
Num

=0

Sum

Ex4.
pa = 9000000
pd = 3600000
input: dependents
Processing: if = 12*(pa + pd * dependents);
Input: income
Processing: ti = income – tf;
If(ti<0) {
Processing: incomeTax = 0;
}else if(ti<=5000000){
Processing: incomeTax = 0.05*ti;
}else if (ti<=10000000){
Processing: incomeTax = 0.1*ti;
}else if (ti<=18000000){
Processing: incomeTax = 0.15*ti;
}else {
Processing: incomeTax =0.2*ti;
}

Start

Input income
n
Set pd= 3600000

Set pa = 9000000

If = 12*(pa +n*pd)

ti = income - tf

Yes No
Ti<=0

Print income tax = 0 Yes No


D<=ti<=5000000

itp = 0 Print income 10000001<=ti No


tax percent = <=18000000
10%

Print income
Yes tax percent =
20%
Print income
tax percent =
15%

itp = 0.1 itp = 0.15 itp = 0.2

Income tax = it*pincome

Print income tax =


Output: incomeTax.

End

You might also like