What's up with the python tax program I wrote -
what's tax rate program i'm writing precise i'm trying figure out why 2.5% isn't showing on program when run it shows different percentage here's i've got far
`
script name: tax program
# author : # purpose: purpose of program ask user enter amount of item purchase. # program should compute state , county sales tax. assume # state sales tax 5 percent , county sales tax 2.5 percent. program # should display amount of purchase, state sales tax, county # sales tax, total sales tax , total of sale (which sum of # amount of purchase plus total sales tax) # use value 0.05 , 0.025 # display "enter item_price amount" # input item_price # display "state tax 5%" # set state_tax= 0.05 # display "county_tax 2.5%" # set county_sales tax = 0.025 county_tax = 0.025 state_tax = 0.05 tax_rate= county_tax + state_tax #ask user enter item price , store in item price varible item_price = float(input("please enter price of item")) item_price =int(100* item_price) total_price = item_price*(1 + tax_rate) #calculate item price @ .05, .025, , .075 tax rate print("your purchase amount ${:0.2f}".format(item_price/100)) print("your county tax rate {}%".format(int(county_tax * 1000 * 20/100))) print("your state tax rate was{}%".format(int(state_tax * 1000 * 20/100))) print("your total sales cost ${:0.2}".format(total_price/100)) print("your total tax rate was{}%".format(int(tax_rate * 1000 * 20/100)))
the problem multiplying values 20/100
no apparent reason 0.025 i.e. 2.5% shown *.2
Comments
Post a Comment