def stateTax(amount): taxRate = 0.05 taxAmount = taxRate * amount print('State tax: ',taxAmount) return taxAmount def countyTax(amount): taxRate = 0.025 taxAmount =...

50.1K

Verified Solution

Question

Programming

def stateTax(amount):
taxRate = 0.05
taxAmount = taxRate * amount
print('State tax: ',taxAmount)
return taxAmount

def countyTax(amount):
taxRate = 0.025
taxAmount = taxRate * amount
print('County tax: ',taxAmount)
return taxAmount

def totalTax(state,county):
taxAmount = state + county
print('Total tax: ',taxAmount)
return taxAmount

def totalAmount(amount, tax):
total = amount + tax
return total
def main():
amount = float(input('Enter the amount of purchase: '))
sTax = stateTax(amount)
cTax = countyTax(amount)
tTax = totalTax(sTax,cTax)
print('Total amount including tax is: ' ,total)

main()

I am a student using python programing.

My goal is to

1. Enter purchase amount

2. Compute State tax

3. Compute County tax

4. Display purchase amount

5. Display state tax

6. Display county tax

7. Display total sales tax

8. Display Total of Sale

How can I fix my line 26 to define total from error saying totalis not defined?

Answer & Explanation Solved by verified expert
4.1 Ratings (720 Votes)
Correct code Calculates stateTax and returns stateTax amountdef stateTaxamounttaxRate 005taxAmount taxRate amountprintState tax taxAmountreturn taxAmount Calculates countyTax and returns countyTaxamountdef countyTaxamounttaxRate    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students