Thursday, May 1, 2008

Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs.12.00 per hour for every hour worked above 40 hours.

Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs.12.00 per hour for every hour worked above 40 hours. Assume that employees do not work for fractional part of an hour.

# SS18

# Script to calculate over-time pay

# Usage: SS18

emp=1

while [$emp -le 10]

do

echo enter working hours

read hours

if[$hours -gt 40]

then

otpay=’expr \($hours -40 \) \* 12‘

echo over time pay = Rs. $otpay

else

echo no over time pay

fi

emp=’expr $emp+1‘

done

No comments: