Question
program that will ask the user to interactively enter a customer's name and the amount of a purchase.Customers get a 12% discount if the purchase
program that will ask the user to interactively enter a customer's name and the amount of a purchase.Customers get a 12% discount if the purchase amount exceeds $1,000.The program should then compute the state and county sales tax.Assume the state sales tax is 5% and the county sales tax is 2.5%.The program should display the amount of the purchase, the discount amount, the net 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 net amount of purchase and the total sales tax).Taxes are based on the net amount after discounts are applied.
Output Format
Customer - xxxxxxxxxxxxxxxx
Amount of purchase - $#,###.##
Discount - $###.##
Net amount after discount - $#,###.##
State sales tax - $#,###.##
County sales tax - $#,###.##
Total sales tax - $#,###.##
Total sales amount - $#,###.##
The program should look like the example below
def main():
# define constants
# get input data
# perform processing operations
# format program output
amount_of_purchase_out = format(amount_of_purchase, ',.2f')
state_sales_tax_out = format(state_sales_tax, ',.2f')
county_sales_tax_out = format(county_sales_tax, ',.2f')
total_sales_tax_out = format(total_sales_tax, ',.2f')
total_sales_amount_out = format(total_sales_amount, ',.2f')
# print program output
print()
print ("Customer - ", customer)
print ("Amount of purchase - $", amount_of_purchase_out)
print ("State sales tax - $", state_sales_tax_out)
print ("County sales tax - $", county_sales_tax_out)
print ("Total sales tax - $", total_sales_tax_out)
print ("Total sales amount - $", total_sales_amount_out)
print()
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