2. Input,processing and also Output Checkpoint Multiple selection True Or False quick Answer Algorithm Workbench Programming exercises

You are watching: Write a program that will ask the user to enter the amount of a purchase

### 22 Feb" data-html="true" data-toggle="tooltip" data-placement="bottom"> Question

Write a regime that will ask the user to enter the quantity of a purchase. The program have to then compute the state and county sales tax. Assume the state sales taxation is 4 percent and also the county sales taxation is 2 percent. The regimen should display screen the quantity of the purchase, the state sales tax, the ar sales tax, the full sales tax, and the full of the sale (which is the amount of the lot of acquisition plus the total sales tax).

Hint: use the worth 0.02 to stand for 2 percent, and 0.04 to represent 4 percent.

### 1Helped junior by posting 31+ answers. " data-html="true" data-toggle="tooltip" data-placement="bottom"> Answer

Python Program:#Get the acquisition amountpurchaseAmount = float(input("Enter the amount of a purchase:"))#Assign the value to State sales taxation percentageStatesalestaxpercentage = 0.04#Assign the worth to county sales taxes percentagecountysalestaxpercentage =0.02#Calculate the state sales taxstatesalestax = purchaseAmount * Statesalestaxpercentage#Calculate the county sales taxcountysalestax = purchaseAmount * countysalestaxpercentage#Calculate the full sales taxTotalsalestax = statesalestax + countysalestax#Calculate the full of the saleTotalofthesale = purchaseAmount + Totalsalestax#Display the required outputprint("The amount of the purchase:",purchaseAmount)print("The state sales tax:",statesalestax)print("The county sales tax:",countysalestax)print("The full sales tax:",Totalsalestax)print("The total of the sale:",Totalofthesale)Sample output:Enter the amount of a purchase:2000The quantity of the purchase: 2000.0The state sales tax: 80.0The county sales tax: 40.0The full sales tax: 120.0The full of the sale: 2120.0

0 0
Next>>

### Discussions

See more: Into The Unknown Over The Garden Wall Lyrics, Over The Garden Wall (Ost)

### 0Helped small by posting 87+ answers. " data-html="true" data-toggle="tooltip" data-placement="bottom"> S

purchaseAmount = float(input("Enter the lot of a purchase:"))Statesalestaxpercentage = 0.04countysalestaxpercentage =0.02statesalestax = purchaseAmount * Statesalestaxpercentagecountysalestax = purchaseAmount * countysalestaxpercentageTotalsalestax = statesalestax + countysalestaxTotalofthesale = purchaseAmount + Totalsalestaxprint("The lot of the purchase:",purchaseAmount)print("The state sales tax:",statesalestax)print("The ar sales tax:",countysalestax)print("The complete sales tax:",Totalsalestax)print("The complete of the sale:",Totalofthesale)