Here is a Python program that accomplishes this task:
```python
# Get the input from the user
purchase_amount = float(input("Please enter the amount of your purchase: "))
# Define the tax rates as percentages
state_tax_rate = 4
county_tax_rate = 2
# Calculate the sales taxes
state_sales_tax = purchase_amount * (state_tax_rate / 100)
county_sales_tax = purchase_amount * (county_tax_rate / 100)
# Calculate the total sales tax and total sale amount
total_sales_tax = state_sales_tax + county_sales_tax
total_sale = purchase_amount + total_sales_tax
# Display the results
print(f"Amount of purchase: ${purchase_amount:.2f}")
print(f"State sales tax: ${state_sales_tax:.2f}")
print(f"County sales tax: ${county_sales_tax:.2f}")
print(f"Total sales tax: ${total_sales_tax:.2f}")
print(f"Total sale: ${total_sale:.2f}")
```
This program takes the purchase amount input from the user, calculates the state and county sales tax rates, and then uses these to determine the total sales tax and final sale amount. The results are then displayed in a clear and concise format.
Design a program that will ask the user to enter the amount of a purchase. The program should the compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 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).
1 answer