Question: Python Third Edition Chapter two . Program exercise two. 6. Sales Tax Using Function and design a program that will ask the user to enter

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 ofthe amount of purchase plus the total sales tax)

Please check my codes

STATE_TAX = .05 COUNTY_TAX = .025 def main (): userinput = user_input() tax_addition = addition_of_tax(userinput) after_tax_purchase = purchase_after_tax(userinput) def user_input(): price = float(input('Enter an amount : ')) state_salesTax = price * STATE_TAX county_sales_tax = price * COUNTY_TAX print('State sales tax is $', format(state_salesTax, ',''.2f' )) print('County sales tax $', format(county_sales_tax,',''.f' )) taxaddition = county_sales_tax + state_salesTax tax_after_purchase = price + taxaddition return taxaddition, tax_after_purchase def addition_of_tax(taxaddion ): print('Tax addition $', format(taxaddion, ',''.f')) def purchase_after_tax( tax_after_purchase): print(format(tax_after_purchase, ',''.2f')) main () 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!