30001 onwards 15%
22001 to 30000 10%
12001 to 22000 7%
5000 to 12000 3%
0 to 5000 0%
Algorithm
Input
1. sa //sales amount, float sa
Output
1. comm //commission
2. Ta //Total amount
Method:
1.start
2. read sa
3. write sa
4. salcom(sa); // calling function
5. stop
1. // Function
void salcom(float sa)
begin
if(sa >= 30001)
begin
comm= sa*0.15;
Ta = sa + comm;
end
else
if( sa>=22001 and sa<=30000 )
begin
comm= sa*0.10;
Ta = sa + comm;
end
else
if( sa>=12001 and sa<=22000 )
begin
comm= sa*0.07;
Ta = sa + comm;
end
else
if( sa>=5000 and sa<=12000 )
begin
comm= sa*0.03;
Ta = sa + comm;
end
else
begin
Ta=sa;
end
print"Commission=",comm;
print" Total Amount=",Ta;
2.stop
No comments:
Post a Comment