Pages

Text

Recent Articles

Nike Sports

Ads 468x60px

Recent Posts

Google Plus

Download

Thursday, 12 April 2012

Write a shell script to read a basic salary of an employee, if basic salary is less than or equal to 5000 then DA will according to 50% of the basic salary and gross salary will be computed as DA + basic salary. If basic salary greater than 5000 then DA according to 25% of basic salary and gross will be DA + basic.

#! /bin/sh
# Write a shell script to read a basic salary of an employee, if basic salary is less than or equal to 5000 then DA will according to 50% of the basic salary and gross salary will be computed as DA + basic salary. If basic salary greater than 5000 then DA according to 25% of basic salary and gross will be DA + basic.
echo "Enter the basic salary of an employee "
read basic
if test $basic -le 5000
then
DA=0.5*$basic
gross=$DA +$basic
echo "The gross salary of an employee is "
echo $gross
else

DA=0.25*$basic
gross=$DA +$basic
echo "The gross salary of an employee is "
echo $gross
fi

0 comments:

Post a Comment