Calculate the weekly average tax withholding for a customer

Assignment Help Mathematics
Reference no: EM132077149

My code needs to have the following elements: calculate the weekly average tax withholding for a customer, given the following weekly income guidelines: Income less than $500: tax rate 10%; Incomes greater than/equal to $500 and less than $1500: tax rate 15%; Incomes greater than/equal to $1500 and less than $2500: tax rate 20%; Incomes greater than/equal to $2500: tax rate 30%. Store the income brackets and rates in a dictionary. Need a loop that prompts the user for an income, looks up the tax rate from the dictionary, and ***prints the income, tax rate, and tax***. The loop runs indefinitely until the user enters a loop termination sentinel. My code works correctly EXCEPT it does not print the "tax rate"(%) as required

def tax(income):

 di={0:10,1:15,2:20,3:30} 

 total_tax=0

 if(income<500):

  total_tax=di[0]*income

 elif(income<1500 and income >=500):

  total_tax=di[1]*income

 elif(income<2500 and income >=1500):

  total_tax=di[2]*income

 else:

  total_tax=di[3]*income

 return total_tax

print("Enter income to calculate tax.")

n=int(input('Enter income :'))

while(n!=-1):

 print("Calculated tax is : ","%.2f"%tax(n))

 n=int(input('Enter income :'))

print('Bye')

Reference no: EM132077149

Questions Cloud

Discuss the relationship between heart rate and exercise : Research the Herzing library for articles on the relationship between heart rate and exercise. Identify at least three reliable sources that will help you.
Research quality dimensions or standards used by various : Research quality dimensions/quality standards/quality indicators used by various health care organizations that work to improve the quality of health care.
What is marketing channels vs changes in technology : Marketing channels VS Changes in technology (online marketing), Levels of service that retailers can offer
What types of problems does one tend to solve : What is a framework and what types of problems does one tend to solve?
Calculate the weekly average tax withholding for a customer : My code needs to have the following elements: calculate the weekly average tax withholding for a customer, given the following weekly
Federal court sitting in diversity jurisdiction : The Erin Doctrine provides that a federal court sitting in diversity jurisdiction over law claim must apply state substantive common law in resolving dispute.
Choose for a website back : With so many languages from which to choose for a website's back end (among them C#, Java, JavaScript, PHP, Python, Ruby, et al.)
Creating marketing plan : External and internal environments of a company before creating a marketing plan.
Perform task with a basic access list : For telnet to the router in particular, how could you perform this task with a basic access list?

Reviews

Write a Review

Mathematics Questions & Answers

  Questions on ferris wheel

Prepare a Flexible Budget Gator Divers is a company that provides diving services such as underwater ship repairs to clients in the Tampa Bay area.

  Logistic map

This assignment has two question related to maths. Questions are related to bifurcation cascade and logistic map.

  Finding the probability of cards

This assignment has questions related to probabiltiy.

  Systems of ode

Find all the xed points, and study their stability and Draw the phase portrait of the system, as well as the graphs of the solutions in all relevant cases.

  Derive the boolean expression

Derive the Boolean Expression and construct the switching circuit for the truth table stated

  System of equations

Evaluate which equations are under-identified, just-identified, and over-identified.

  Linear programming problem

Linear programming problem consisting of only two constraints with one objective function.

  Find the natural domain

Find the natural domain of the given functions.

  Introduction to numerical methods

Compute the coecients of the polynomials using the term recurrence relation.

  Chart of the topological manifold

De?nition of smoothness of functions on a smooth manifold is chart independent and hence geometric.

  Mathematics in computing

Questions related on mathematics in computing.

  Complex problems

Complex problems

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd