Write the Flowchart, and Python code for the following programming problem. Use
ID: 3623134 • Letter: W
Question
Write the Flowchart, and Python code for the following programming problem. Use modules in developing the logic.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)
Use the following modules/functions for your program:
• main that calls your other functions
• inputData that will ask for the monthly sales
• calcCounty that will calculate the county tax
• calcState that will calculate the state tax
• calcTotal that will calculate the total tax
• printData that will display the county tax, the state tax, and the total tax
RAPTOR will default to global variables.
For Python program, it is ok to use global variables; although local variables are preferred.
If your program is correct, sample output might look as follows:
Welcome to the total tax calculator program
Enter the total sales for the month $12567
The county tax is $ 251.34
The state tax is $ 502.68
The total tax is $ 754.02
Explanation / Answer
Dear,
Here is the code
#calculate sale tax program
def InputDate():
print "Welcome to sales Tax calculation program "
sales=input("Enter monthly sales: ")
return sales
def calCountry(sale):
countryTax=sale*0.02
return countryTax
def calcState(sale):
stateTax=sale*0.04
return stateTax
def calcTotal(ctax,stax)
return ctax+stax
def printData(ctax,stax,ttax):
print"The country tax is $",ctax
print"The state tax is $",stax
print"The total tax is $",ctax
# Main program
Sales=InputData()
contryTax= calCountry(sales)
stateTax= calcState(sales)
totalTax= calcTotal(contryTax,stateTax)
printData(contryTax,stateTax,totalTax)
Hope this will help you
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.