:
: 'Calculate user booking rate and limit'
if test $# -ne 2
then
	echo Usage: fdl sess/week max-sequential-booking
	exit
fi
: 'cost factor (average)'
a=5
:
: 'rate = 336 / (cost * sess-per-week)'
b=`expr 336 / \( $a \* $1 \)`
:
: 'limit = rate * cost * sess-in-a-row'
c=`expr $b \* $a \* $2`
:
: 'sess-per-week = 336 / (cost * rate)'
d=`expr 336 / \( $a \* $b \)`
if test $d -ne $1
then
	echo "rate = $b	limit = $c	(sess-per-week = $d)"
else
	echo "rate = $b	limit = $c"
fi
if test $b -gt 255 -o $b -eq 0 
then echo Warning: rate out of range
fi
if test $c -gt 255 -o $c -eq 0
then echo Warning: limit out of range
fi
