Write a method named computeTax that accepts a salary as a parameter and that returns the amount of tax you would owe if you make that salary. The tax is based on your tax bracket as found from 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 on $27,500 is $3,767.50. For $6,000, the tax is $600. For $120,000, the tax is $28,227. Assume your method is passed a value > 0. over but not over flat amount $0 $0 $7,150 $7150 $29,050 $29,050 $70,350 $70,350 unlimited $715 $4000 $14,325 plus % of excess over 10% $0 15% 25% 28% $7,150 $29,050 $70,350

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question

The assignment is asking to write a Java "method" as described not a complete program or class. 

2 computeTax ♡
Language/Type:
Java if/else method basics return
Write a method named computeTax that accepts a salary as a parameter and that
returns the amount of tax you would owe if you make that salary. The tax is based on
your tax bracket as found from 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 on $27,500 is $3,767.50. For $6,000, the tax is
$600. For $120,000, the tax is $28,227. Assume your method is passed a value > 0.
V
over
but not over flat amount plus % of excess over
SO
10%
$0
$715
15%
$4000
25%
$14,325
28%
SO
$7,150
$7150 $29,050
$29,050 $70,350
$70,350 unlimited
$7,150
$29,050
$70,350
2
2
2
25
26
27
26
29
30
Transcribed Image Text:2 computeTax ♡ Language/Type: Java if/else method basics return Write a method named computeTax that accepts a salary as a parameter and that returns the amount of tax you would owe if you make that salary. The tax is based on your tax bracket as found from 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 on $27,500 is $3,767.50. For $6,000, the tax is $600. For $120,000, the tax is $28,227. Assume your method is passed a value > 0. V over but not over flat amount plus % of excess over SO 10% $0 $715 15% $4000 25% $14,325 28% SO $7,150 $7150 $29,050 $29,050 $70,350 $70,350 unlimited $7,150 $29,050 $70,350 2 2 2 25 26 27 26 29 30
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,