Taxes

Mission
Create a a program that asks the user for their gross income and outputs their actual money remaining after taxes.

Details

Your program will define a few functions (aka methods) that will determine the taxes paid on an individual's income.  After calling each method in the correct order, your program will output the remaining money.

You should define the following methods.  You should use the values listed for each method shown below.  These are not accurate to the actual MD / federal tax code.

state_income_tax
 - parameters: the user's gross income
 - returns: amount of dollars paid in taxes
  - tax at a flat 3% rate

payroll_tax
 - parameters:  the user's gross income
 - returns: amount of dollars paid in taxes
 - if income <= $100,000, tax at 5% rate
    else, tax exactly $5000.

federal_income_tax
  - parameters:  the user's gross income
  - returns: amount of dollars paid in taxes
  - if income >= 200,000, tax at 30% rate
    else if income >= 100,000 tax at 20% rate
    else if income >= 50,000 tax at 10% rate
    else  tax at 5% rate

state_sales_tax
 - parameters:  the user's net income after income and payroll taxes
 - returns: amount of dollars paid in taxes
  - tax at a flat 6% rate


Three of these taxes are applied at the same time (state income, payroll, and federal income).  They should each be passed the user's gross income (what they inputted).  Then, subtract all the taxes from the gross income.  This provides your net income.  The user would still be taxed on that money when he or she spends it, however, so you need to call one last method - the state sales tax.

Example Program

Please enter your income:  80,000
You must pay $14,400 in taxes, leaving you with $65,600 of net income.
If you spend all your money, you effectively spent $61,664 after sales tax.

EXTRA CREDIT

Make a more realistic tax program.  To do so, change the federal income tax method so that it implements a marginal tax rate with five different levels based on the actual US Tax Code.  Assume the user is not married.  This means an individual is taxed on multiple levels for each section of the his income that falls in a certain range.

Look online for more explanations or ask Mr. M to explain the marginal tax system before you attempt this extra credit.

http://en.wikipedia.org/wiki/Income_tax_in_the_United_States#Marginal_tax_rates_for_2013



No comments:

Post a Comment