ok here is my problem i just wrote this program its gonna take a price and a discount code and give a quick discount to it but when i run the program it will double the price from it original when it supposed to taking it off.... well hereis the code if anyone can tell me where i went wrong that would be a big help thank you very much
Code:
#! /bin/ksh
# +--------------------+
# | BOBBY D ESTRADA |
# +--------------------+
print -n "\n Please Enter Price: "
read price
print -n "\n Please Enter Coupon Code: "
read code
case $code in
H|h)
total=`print "scale=3; $price / .50"|bc`
;;
F|f)
total=`print "scale=3; $price / .40"|bc`
;;
T|t)
total=`print "scale=3; $price / .33"|bc`
;;
Q|q)
total=`print "scale=3; $price / .25"|bc`
;;
*)
print "\nNO DISCOUNT"
total=$price
;;
esac
print "\nPrice: $price\nCode: $code\nTotal:$total "