Question

In: Computer Science

This assignment will give you more experience on the use of: 1. integers (int) 2. floats...

This assignment will give you more experience on the use of:

1. integers (int)

2. floats (float)

3. conditionals(if statements)

4. iteration(loops)

Functions, lists, dictionary, classes CANNOT BE USED!!!

The goal of this project is to make a fictitious comparison of the federal income. You will ask the user to input their taxable income. Use the income brackets given below to calculate the new and old income tax. For the sake of simplicity of the project we will only consider individuals and not married users. We will also ignore any tax deductions while calculating income tax—they can significantly alter the tax, but add too much complexity for our programming project.

New income tax brackets (2018 and newer)

10% Up to $9,525

12% $9,526 to $38,700

22% $38,701 to $82,500

24% $82,501 to $157,500

32% $157,501 to $200,000

35% $200,001 to $500,000

37% over $500,000

Old income tax brackets (2017 and older)

10% Up to $9,325

15% $9,326 to $37,950

25% $37,951 to $91,900

28% $91,901 to $191,650

33% $191,651 to $416,700

35% $416,701 to $418,400

39.6% over $418,400

Assignment Background

Being in the 25% tax bracket doesn’t mean you pay 25% on everything you make. The progressive taxsystem means that people with higher taxable incomes are subject to higher tax rates, and people withlower taxable incomes are subject to lower tax rates.

For example, let’s say you’re a filer with $32,000 in taxable income. That puts you in the 15% taxbracket in 2017. But do you pay 15% on all $32,000? No. Actually, you pay only 10% on the first$9,325; you pay 15% on the rest. (Look at the tax brackets above to see the breakout.)

If you had $50,000 of taxable income, you’d pay 10% on that first $9,325 and 15% on the chunk ofincome between $9,326 and $37,950. And then you’d pay 25% on the rest, because some of your$50,000 of taxable income falls into the 25% tax bracket. The total bill would be $8,238.75 — about16% of your taxable income, even though you’re in the 25% bracket.

Project Description

Your program must meet the following specifications:

1. At program start, prompt the user for their income

2. Repeatedly prompt the user for new income until a negative income is entered.

3. Calculate the income tax using the 2017 and 2018 tax bracket tables above.

4. For each income entered:

a. Calculate the 2017 income tax and store it in a variable.

b. Next calculate the 2018 income tax and store it in a variable

c. Print

i. The income

ii. The 2017 taxi

iii. The 2018 tax

iv. The difference between the 2018 and 2017 tax rounded to cents

v. The difference between the 2018 and 2017 tax as a percentage of the 2017 taxrounded to cents

Assignment Notes

1. To clarify the project specifications, sample output is appended to the end of this document.

2. Use a while loop with a Boolean that keeps looping as long as the income is greater than or equal to zero.

3. Prompt for income before the loop and remember to convert the input string to an int (so you are comparing an int in your Boolean expression). Remember to prompt again at the end (aka “bottom”) of the loop.

4. There will be no error checking in this assignment. If a float or a string is entered at the prompt, the program will crash.

Example Outputs:

Enter income as an integer with no commas: 8000

Income: 8000

2017 tax: 800.00

2018 tax: 800.00

Difference: 0.00

Difference (percent): 0.00

Enter income as an integer with no commas: 15000

Income: 15000

2017 tax: 1783.75

2018 tax: 1609.50

Difference: -174.25

Difference (percent): 9.77

Enter income as an integer with no commas: 40000

Income: 40000

2017 tax: 5738.75

2018 tax: 4739.50

Difference: -999.25

Difference (percent): 17.41

Solutions

Expert Solution

Part 1:

Part 2:

# calculating 2017 tax
if(income <= 9325):
    tax_2017 = income * 0.1
elif(income <= 37950):
    tax_2017 = (9325*0.1) + (income - 9325) * 0.15
elif(income <= 91900):
    tax_2017 = (9325*0.1) + ((37900-9325)*0.15) + (income - (37900)) * 0.25
elif(income <= 191650):
    tax_2017 = (9325*0.1) + ((37900-9325)*0.15) + ((91900-37900)*0.25) + (income - (91900)) * 0.28
elif(income <= 416700):
    tax_2017 = (9325*0.1) + ((37900-9325)*0.15) + ((91900-37900)*0.25) + ((191650-91900)*0.28) + (income - (191650)) * 0.33
elif(income <= 418400):
    tax_2017 = (9325*0.1) + ((37900-9325)*0.15) + ((91900-37900)*0.25) + ((191650-91900)*0.28) + ((416700-191650)*0.33) +\
               (income - (416700)) * 0.35
elif(income > 418400):
    tax_2017 = (9325*0.1) + ((37900-9325)*0.15) + ((91900-37900)*0.25) + ((191650-91900)*0.28) + ((416700-191650)*0.33) +\
               ((500000-416700)*0.35) + (income - (418400)) * 0.396

Related Solutions

This assignment will give you more experience on the use of: 1. integers (int) 2. floats...
This assignment will give you more experience on the use of: 1. integers (int) 2. floats (float) 3. conditionals 4. iteration The goal of this project is to make a fictitious comparison of the federal income. You will ask the user to input their taxable income. Use the income brackets given below to calculate the new and old income tax. For the sake of simplicity of the project we will only consider individuals and not married users. We will also...
[Python programming] Functions, lists, dictionary, classes CANNOT BE USED!!! This assignment will give you more experience...
[Python programming] Functions, lists, dictionary, classes CANNOT BE USED!!! This assignment will give you more experience on the use of: 1. integers (int) 2. floats (float) 3. conditionals(if statements) 4. iteration(loops) The goal of this project is to make a fictitious comparison of the federal income. You will ask the user to input their taxable income. Use the income brackets given below to calculate the new and old income tax. For the sake of simplicity of the project we will...
For Part 2 of this assignment, you will use the “Assignment 1 – Linear Kinematics Data”...
For Part 2 of this assignment, you will use the “Assignment 1 – Linear Kinematics Data” excel file. In the data set you are provided with vertical position and time data for a person’s vertical center of mass motion for an unspecified movement task. You will utilize excel in all (well, some…) of its glory to calculate the vertical velocity and vertical acceleration data from the position and time data provided in the excel file. Again you will use the...
2. Give an example of a service experience in which you participated, or witnessed, that was...
2. Give an example of a service experience in which you participated, or witnessed, that was good or excellent because of the presence of an expert customer?. What did the customer say, or do, to identify them as an expert consumer of the service? What happened, or didn't happen, in the delivery of the service because the consumer was an expert? How did the consumer's expertise impact their perception of the service? How did the consumer's expertise impact other customers...
in C++ .....For this assignment you will calculate the average of a series of integers. You...
in C++ .....For this assignment you will calculate the average of a series of integers. You will use a while loop to repeatedly ask the user to enter a value until the user enters the sentinel value. Program results will be output to an external text file. Average of Ints Write a program that calculates and prints the average of several integers. Assume that last value read is the sentinel 9999. A typical input sequence might be: 10 8 11...
In this assignment you are going to use the menu you created in Assignment 1 to...
In this assignment you are going to use the menu you created in Assignment 1 to test both your Double and Integer classes. You should add functionality to the menu to allow you test the add, sub, mul, div functions for instances of both classes You are going to have make a modification to your menu class. Currently it uses an array to hold a fixed amount of menu items. While this may be OK for most applications we want...
Purpose This assignment should give you experience in using file descriptors, open(), close(), write(), stat() and...
Purpose This assignment should give you experience in using file descriptors, open(), close(), write(), stat() and chmod(), perror(), and command line arguments. Program Write a C++ program that will allow you to add messages to a file that has NO permissions for any user. A Unix system has many files that have sensitive information in them. Permissions help keep these files secure. Some files can be publicly read, but can not be altered by a regular user (ex.: /etc/passwd). Other...
Give an example of integers a, b, m such that a 2 ≡ b 2 (mod...
Give an example of integers a, b, m such that a 2 ≡ b 2 (mod m), but a 6≡ b (mod m)
Assignment 2: Healthcare Informatics and System Breaches Use this Scenario for this Assignment. You are the...
Assignment 2: Healthcare Informatics and System Breaches Use this Scenario for this Assignment. You are the Health Information Officer at a large hospital. You have learned a significant information technology failure or breach has occurred within your hospital. Using the Internet or the Strayer University library database, identify other health care organizations or healthcare providers that have recently had a significant information technology failure or breach. Write a report to your staff, notifying them of the failure or breach, who...
1. "Give an example of a function that is defined on the set of integers that...
1. "Give an example of a function that is defined on the set of integers that is not a one-to-one function." Keep in mind that the above domain must be the set of integers. Identify what your codomain is, too. 2. "Give an example of a function that is defined on the set of rational numbers that is not an onto function." The above domain must be the set of rational numbers. Identify what your codomain is, too. This is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT