dicount calculator code