Question: Listing 3.5 gives a program to compute tax. Write a method for computing tax using the following header:public static double?computeTax(int?status,?double?taxableIncome)Use this method to write a

Listing 3.5 gives a program to compute tax. Write a method for computing tax using the following header:public static double?computeTax(int?status,?double?taxableIncome)Use this method to write a program that prints a tax table for taxable income from$50,000 to $60,000 with intervals of $50 for all the following statuses:Married Joint able Single Married Head of or Qualifying Widow(er) Income Separate

a House 6665 8688 50000 8688 7353 50050 8700 6673 8700 7365

9840 59950 11175 8158 11175 8165 9853 60000 11188 11188 Listing 1

Married Joint able Single Married Head of or Qualifying Widow(er) Income Separate a House 6665 8688 50000 8688 7353 50050 8700 6673 8700 7365 9840 59950 11175 8158 11175 8165 9853 60000 11188 11188 Listing 1 import java.util.Scanner; 3 public class ComputeTax { public static void main(String[] args) { // Create a Scanner Scanner input - new Scanner(System.in); // Prompt the user to enter filing status System.out.print("(0-single filer, 1-married jointly or " "qualifying widow(er), 2-married separately, 3-head of " "household) Enter the filing status: "); 9. 10 11 12 13 14 15 int status - input.nextInt(); // Prompt the user to enter taxable income System.out.print("Enter the taxable income: "); double income - input.nextDouble(); 17 18 19 20 21 // Compute tax double tax - 0; 24 25 26 27 28 29 30 31 32 if (status == 0) { // Compute tax for single filers if (income < 8350) tax = income * 0.10; else if (income

Step by Step Solution

3.49 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Program plan Step 1 Create a test class called ComputeTaxDemo ... View full answer

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 Java Programming Questions!