Algorithm
Step 1 : Start
Step 2 : Read basic
Step 3 : If basic > 30000 then
hra is 5% of basic
da is 5% of basic
tax is 10% of basic
Step 3.1 : else if basic > 20000 then
hra is 4% of basic
da is 3% of basic
tax is 8% of basic
Step 3.2 : else
hra is 3% of basic
da is 2% of basic
tax is 5% of basic
Step 4 : Stop
Program (emppay.sh)
echo -n "Enter employee basic pay : "
read basic
if [ $basic -gt 30000 ]
then
hra=`expr 5 \* $basic / 100`
da=`expr 5 \* $basic / 100`
tax=`expr 10 \* $basic / 100`
elif [ $basic -gt 20000 ]
then
hra=`expr 4 \* $basic / 100`
da=`expr 3 \* $basic / 100`
tax=`expr 8 \* $basic / 100`
else
Step 1 : Start
Step 2 : Read basic
Step 3 : If basic > 30000 then
hra is 5% of basic
da is 5% of basic
tax is 10% of basic
Step 3.1 : else if basic > 20000 then
hra is 4% of basic
da is 3% of basic
tax is 8% of basic
Step 3.2 : else
hra is 3% of basic
da is 2% of basic
tax is 5% of basic
Step 4 : Stop
Program (emppay.sh)
echo -n "Enter employee basic pay : "
read basic
if [ $basic -gt 30000 ]
then
hra=`expr 5 \* $basic / 100`
da=`expr 5 \* $basic / 100`
tax=`expr 10 \* $basic / 100`
elif [ $basic -gt 20000 ]
then
hra=`expr 4 \* $basic / 100`
da=`expr 3 \* $basic / 100`
tax=`expr 8 \* $basic / 100`
else