taxrate = 0.125print “Enter price: “s = getssubtotal = s.to_…

taxrate = 0.125print “Enter price: “s = getssubtotal = s.to_fif (subtotal < 0.0) then subtotal = 0.0endtax = subtotal * taxrateputs "Tax on $#{subtotal} is $#{tax}, so grand total is $#{subtotal+tax}" The end keyword that terminates the if block is optional in the code above.