SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Tony Gaddis
Chapter:
Simple Functions
Exercise:
Programming Exercises
Question:10 | ISBN:9780132576376 | Edition: 2

Question

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)

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

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
>>>

 

0 0

Discussions

Post the discussion to improve the above solution.