Write a shell script to develop an APP to calculate the net salary of an employe
ID: 3891282 • Letter: W
Question
Write a shell script to develop an APP to calculate the net salary of an employee.
The DA, HRA, TA and Other Allowances (OA) are given. Follow the constraints and find out the amount to be deducted using the proper PF and IT calculation. Your APP has to display its contents with the menu option and the input is the Basic salary. DA: 14% of Basic salary HRA: $175 TA: $150 other allowances (OA): $400 Deduction –
a) PF: 12% of Basic salary and
b) IT: 15% of Basic salary Net Salary = Basic Salary + DA + HRA + TA + OA – (PF + IT)
Explanation / Answer
Hello,
Below is the shell script you need, If you need any change you can absolutely make it.
echo Enter Basic Salary
read BaSal
if [ $BaSal -lt 1500 ]
then
HRA=`echo $BaSal*10/100|bc`
DA=`echo $HRA*14/100|bc`
else
HRA=500
DA=`echo $BaSal*98/100|bc`
echo DA is=Dollar.$DA
fi
gs=`echo $BaSal+$HRA+$DA|bc`
echo IT=Dollar.$gs
Hope, I have solved your problem. Thank you :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.