28.9k views
2 votes
Read the following program requirements prior to completing the Hands-on. 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. 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) Step 1: Write the steps the algorithm:

User Magnum
by
5.3k points

1 Answer

2 votes

Answer:

state_sales_tax_rate = 0.04

county_sales_tax_rate = 0.02

sales = float(input("Enter the total sales for the month: "))

county_sales_tax = sales * county_sales_tax_rate

state_sales_tax = sales * state_sales_tax_rate

total_sales_tax = county_sales_tax + state_sales_tax

print("The amount of county sales tax is " + str(county_sales_tax))

print("The amount of state sales tax is " + str(state_sales_tax))

print("The total sales tax is " + str(total_sales_tax))

Step-by-step explanation:

*The code is in Python.

Set the state_sales_tax_rate and county_sales_tax_rate

Ask the user to enter the sales

Calculate the county_sales_tax, multiply sales by county_sales_tax_rate

Calculate the state_sales_tax, multiply sales by state_sales_tax_rate

Calculate the total_sales_tax, sum county_sales_tax and state_sales_tax

Print the results

User Shaida
by
4.5k points