Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Calculate the gross salary

Posted By: Adela Fischer     Category: Unix / Linux / Ubuntu     Views: 19540

The person' basic salary is input through keyboard. His dearness allowance is 40% of the basic salary and HRA is 20% of the basic salary. WAP to calculate the gross salary.

Code for Calculate the gross salary in Unix / Linux / Ubuntu

echo -e "Enter ur basic salary \c"
    read sal
    if [ $sal -ge 1000 ]
    then
             da=`expr $sal \* 40 / 100`
            ha=`expr $sal  \* 20  / 100`
         Nsal=`expr $sal + $da + $ha`
         echo "ur Basic Salary        $sal "
         echo "ur Dearness Allowance    $da "
         echo "Ur House rent            $ha "
         echo "                     ------------"
         echo "Ur Net Salary is   Rs. $Nsal "else
        echo "Pls enter basic salary greater than 1000 "
    fi           

---------------------------------------------------------------------------------

output:

$ q1
Enter ur basic salary 2000
ur Basic Salary        2000
  
Share: 


Didn't find what you were looking for? Find more on Calculate the gross salary Or get search suggestion and latest updates.

Adela Fischer
Adela Fischer author of Calculate the gross salary is from Frankfurt, Germany.
 
View All Articles

 

Other Interesting Articles in Unix / Linux / Ubuntu:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!