Question: Task 2 : computeTax ( ) Write a method named computeTax that accepts a salary as a parameter and returns the amount of tax you

Task 2: computeTax()
Write a method named computeTax that accepts a salary as a parameter and returns the amount
of tax you would owe if you made that salary. The tax is based on your tax bracket found in the
first two columns below. Once you know which row to use, start with the "flat amount" and add
the "plus %" of the amount over the amount listed in the final column. For example, if your
income is $50,000, then you use the third row of the table and compute the tax as $4,000 plus
25% of the amount over $29,050, which comes to $9,237.50. The total tax of $27,500 is
$3,767.50. For $6,000, the tax is $600. For $120,000, the tax is $28,227. If a negative salary is
given, your method should return -1.

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 Databases Questions!