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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education