Python Third Edition Chapter two . Program exercise two. 6. Sales Tax Using Function and design a program that will ask the user to enter the amount of a purchase. The program should then compute the...




Python Third Edition Chapter two . Program exercise two.
6. Sales Tax
Using Function and design a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 5 percent and the county sales tax is 2.5 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the total sales tax)
Please check my codes STATE_TAX = .05 COUNTY_TAX = .025
def
main ()  user input = user _input()   tax_ addition = addition _of_ tax(user input)    after_ tax _purchase = purchase _after_ tax(user input)
def
user_ input():   price = float(input('Enter an amount : '))   State _sales Tax = price * STATE_TAX County _sales_ tax = price * COUNTY_TAX  print('State sales tax is $', format(state_ sales Tax,
',''.2f'
))  print('County sales tax $', format(county_ sales _tax,',' '.f'
)   tax addition = county_ sales _tax + state _sales Tax    tax _  after_ purchase = price + tax additionreturn
tax addition, tax_ after_ purchase
Defaddition_ of_ tax(tax addition ): print('Tax addition $', format(tax addition,
',''.f'))
defpurchase_ after _tax( tax_ after_ purchase):  print(format(tax_ after_ purchase,
',''.2f'))  main ()

May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here