postheadericon Write a shell script to mathematics calculation


Definition: Write a script to calculate gross salary for any number of employees

                                   Gross Salary =Basic + HRA + DA.
                                   HRA=10% and DA= 15%.

File Name : ex19.sh



clear
echo "Enter Basic Salary :\c"
read bs
if [ $bs -lt 1500 ]
then
  hra=`echo $bs \* 10 / 100 | bc`
  da=`echo $bs \* 15 /100 | bc`
else
   hra=500
   da=`echo $bs \* 98/100 | bc`
fi
gs=`echo $bs + $hra + $da | bc`

echo " DA : $da"
echo " HRA :  $hra"
echo "GROSS SALARY : $gs"


0 comments:

Follow by Email

Total Pageviews

© BipinRupadiya.com. Powered by Blogger.