Monthly Sales Tax
A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent. Write a program that asks the user to enter the
total sales for the month. From this figure, the application should calculate and display the following:
• The amount of county sales tax
• The amount of state sales tax
• The total sales tax (county plus state)
Monthly Sales Tax report
Code:
# monthly sales tax report
# asks the user to enter the
# total sales for the month.
total_sales = float(input('Enter the total sales for the month: $'))
# county sales tax rate is 2 percent
county_sales_tax = total_sales * 0.02
# state sales tax rate is 4 percent
state_sales_tax = total_sales * 0.04
# total sales tax (county plus state)
total_sales_tax = county_sales_tax + state_sales_tax
# Display
print('The amount of county sales tax: $', county_sales_tax)
print('The amount of state sales tax: $', state_sales_tax)
print('The total sales tax (county plus state): $', total_sales_tax)
output:
Enter the total sales for the month: $905600.36
The amount of county sales tax: $ 18112.0072
The amount of state sales tax: $ 36224.0144
The total sales tax (county plus state): $ 54336.0216
>>>