Basic salary of a person is input through the keyboard. His dearness allowance is 40% of basic salary and house rent in 20% of basic salary. Write a program to calculate the gross pay.

   

-----------------------------Script---------------------------
echo "Enter the basic salary : "
read salary
dearness=`echo "$salary * 0.40" | bc`
hrent=`echo "$salary * 0.20" | bc`
salary=`echo "$salary + $dearness + $hrent" | bc`
echo "Dearness Allowance = $dearness "
echo "House Rent = $hrent"
echo "Gross Salary = $salary"  

-----------------------------output---------------------------
Enter the basic salary :
10000
Dearness Allowance = 4000.00
House Rent = 2000.00
Gross Salary = 16000.00

-----------------------------END------------------------------
SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment