6. Sales Tax Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 5 percent and the county sales tax is 2.5 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). Hint: Use the value 0.025 to represent 2.5 percent, and 0.05 to represent 5 percent.
Added by Nancy M.
Close
Step 1
First, we need to ask the user to enter the amount of the purchase. We can use the `input()` function to get the user's input and store it in a variable called `purchase_amount`. ```python purchase_amount = float(input("Enter the amount of the purchase: ")) ``` Show more…
Show all steps
Your feedback will help us improve your experience
Supreeta N and 98 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a Python program that will calculate the amount and cost of purchasing flooring. The user will enter the length of the room, the width of the room, and the cost of the flooring per square foot. Calculate the total square feet, flooring cost, tax (7%), and total amount due. Display and identify the output for the total square feet needed, the calculated cost of the flooring, tax amount (7% of the total flooring cost), and the total (final cost). Sample Input Example: Room Length: 60 Room Width: 2 Sample Output Example: Flooring Cost Square feet: 120 Flooring (5.39/sq. ft) $646.80 Tax (7%) $45.28 Total $692.08
Akash M.
Write a program in python to calculate net salary after input basic salary, hra, da and tax net =basic + hra + da -tax
Liam H.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD