Question: Make sure to verify your code matches the specification below word by word. If your outputs don't match, re - read this carefully, word by

Make sure to verify your code matches the specification below word by word. If your outputs don't match, re-read this carefully, word by word.
Some degree of redundancy is acceptable in the design of the if statements in this problem.
A Tax computation rule is described as follows.
Three inputs come in: income, married or not, number of exemptions claimed.
Any individual can claim exemptions, up to a maximum of 3.(0,1,2 or 3)
For singles, each exemption is worth 375 dollars.
For married people, each exemption is worth 500 dollars.
So, a married person claiming 2 exemptions gets 1000$ total exemption.
The total exemption amount is subtracted from the income to compute the taxable income.
The tax rate is determined based on the taxable income, using the following rule:
Single: for amounts above 100,000 Rate is 18%
otherwise15%
Married: for amounts above 150,000 Rate is 30%
otherwise 20%
The tax is computed using taxable income and tax rate.
You can assume not married is the same as single. You can collect this input (married or not), in any way you prefer. You can assume all three inputs will be supplied by the user as directed by the program.
Implement the computations above, and display tax.
Comments:
Assume the user will enter 0,1,2 or 3 as expected for the number of exemptions. You do not need to write code to verify this range of values.
The emphasis in this problem is on: accuracy, and well-designed, and efficient if statements. For accuracy, you are given sample data below, and if your outputs do not match, revisit the specifications, and read them closely; review your if statements to see if there are redundant conditions, or computations that repeat under every branch etc; review prior material on if statements.
Note that in this problem the married or not affects two different stages of computations; and it is okay to write the if for married or not twice when dealing with that. That is not the only way to construct the if statements in this problem, but it may yield a clean and simple design.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!