Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started