subject

Write a static method named tax that accepts a salary as a parameter and that returns the amount of federal tax you would owe if you make that salary. The tax is computed based on your tax bracket as found from the first two columns below. Once you know which row of the table 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 on $27,500 is $3,767.50. For $6,000, the tax is $600. For $120,000, the tax is $28,227. over but not over flat amount plus % of excess over $0 $7,150 $0 10% $0 $7,150 $29,050 $715 15% $7,150 $29,050 $70,350 $4,000 25% $29,050 $70,350 unlimited $14,325 28% $70,350 You may assume that your method is passed a value greater than or equal to 0. Finish the following code file: public class TestTax { public static void main(String[] args) { System. out. println("The tax on $50000 is " + tax(50000)); // 9237.5 System. out. println("The tax on $27500 is " + tax(27500)); // 3767.5 System. out. println("The tax on $6000 is " + tax(6000)); // 600.0 System. out. println("The tax on $120000 is " + tax(120000)); // 28227.0 }

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:20, autumnguidry1622
Write a method replacekey in the minheap class with the following signature: public void replacekey(integer oldkey, integer newkey) the method will replace the first occurrence of oldkey with the newkey, and restore the min-heap property after the change. if the oldkey does not exist in the heap, the method prints an appropriate message and returns without changing the heap. example: suppose our binary heap object (bh) has the following keys: *** 4 6 7 32 19 64 26 99 42 54 28 then the method call: bh. replacekey (oldkey integer(54), newkey integer(2))
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, wwesuplexcity28
To become an audio technician, the most successful tactics might include the following. (select all that apply). learning how to persuade other people gaining different types of experience in audio technology learning as much as possible about art history establishing a reputation as a reliable professional
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, Zieken993
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, darlene93
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
You know the right answer?
Write a static method named tax that accepts a salary as a parameter and that returns the amount of...

Questions in other subjects:

Konu
Mathematics, 20.03.2022 19:10
Konu
Chemistry, 20.03.2022 19:20
Konu
Chemistry, 20.03.2022 19:40