Convert a main-method-only solution (see the .java file below) for income tax calculation in the textbook (see IncomeTax-eTextPage90-93.pdf) to a solution that uses multiple methods to make the task...

1 answer below »

Convert a main-method-only solution (see the .java file below) for income tax calculation in the textbook (see IncomeTax-eTextPage90-93.pdf) to a solution that uses multiple methods to make the task more manageable.



ComputeTax3.java



IncomeTax-eTextPage90-93.pdf


Here are things you will need to do:



  1. Define a methodprintTaxCategorythat prints the tax category description given an integer tax status code.If the tax code is incorrect, exit the program.

  2. Define methodcalcIncomeTaxthat returns the income tax, given six parameters, income, bound1, bound2, bound3, bound4, and bound5. The method can assume that the tax code is valid, that is, 0, 1, 2, or 3.This method should be the same as the the calcTax method in problem above.

  3. In the main method, do the following in order:


    1. Prompt the user to enter the tax status code and income. [DONE, provided in the starter code]

    2. Invoke the methodprintTaxCategory to print the description of the tax category.

    3. Use a multi-branch if statement and invoke the method calcIncomeTax with proper values for the five bounds for different income brackets to obtain the tax amount and assign it to a variable.



The following is sample run. The green fonts represent user inputs.





  1. ComputeTax3_Run.JPG



Answered 1 days AfterFeb 15, 2022

Answer To: Convert a main-method-only solution (see the .java file below) for income tax calculation in the...

Arun Shankar answered on Feb 16 2022
112 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here