Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions