Question: Listing 3.5, ComputeTax.java, gives the source code to compute taxes for single filers. Complete Listing 3.5 to compute the taxes for all filing statuses. Listing

Listing 3.5, ComputeTax.java, gives the source code to compute taxes for single filers. Complete Listing 3.5 to compute the taxes for all filing statuses.

Listing 3.5

1 import java.util.Scanner; 3 public class ComputeTax { public static void main(String]

args) { 4 // Create a Scanner Scanner input - new Scanner

1 import java.util.Scanner; 3 public class ComputeTax { public static void main(String] args) { 4 // Create a Scanner Scanner input - new Scanner (System.in); 5 // 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: "); 10 11 12 int status - input.nextInt(); 13 14 15 16 17 18 19 20 21 22 23 // Prompt the user to enter taxable income System.out.print("Enter the taxable income: "); double income - input.nextDouble(); // Compute tax double tax - 0; if (status -- 0) { // Compute tax for single filers if (income

Step by Step Solution

3.30 Rating (171 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To generate the tax depending upon the entered status of teh user ... 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!