title: How to condense this java program?
body: <p>I'm trying to condense this code so its more leaner. I know there has to be a way to use the calculation from the past else if statement to use it in the next tax bracket calculation. I tried to put tax = ph in each else if statement to use in the next calculation (for place holder value) but it will just ignore it.
  Edit: rewording this here to not sound like feedback. My code is too long how can I make it shorter? Also I have to use the switch statement in this assignment.</p>
  
  <pre><code>    public static void main(String[] args) {
  
      Scanner input = new Scanner(System.in);
  
     System.out.print(
    "(0-single filer, 1-married jointly or qualifying widow(er), "
    + "\n2-married separately, 3-head of household)\n" +
    "Enter the filing status: ");
  
  int status = input.nextInt();
  
  System.out.print("Enter the taxable income: ");
  double income = input.nextDouble();
  double tax = 0;
  
  
  
  switch (status){
      case 0: {      // file single
         if (income &lt;= 8350)
         tax = income * 0.10;
         else if (income &lt;= 33950)
          tax = 8350 * 0.10 + (income - 8350) * 0.15;
         else if (income &lt;= 82250)
          tax = 8350 * 0.10 + (33950 - 8350) * 0.15 +
          (income - 33950) * 0.25;
         else if (income &lt;= 171550)
           tax = 8350 * 0.10 + (33950 - 8350) * 0.15 +
          (82250 - 33950) * 0.25 + (income - 82250) * 0.28;
         else if (income &lt;= 372950)
           tax = 8350 * 0.10 + (33950 - 8350) * 0.15 +
           (82250 - 33950) * 0.25 + (171550 - 82250) * 0.28 +
           (income - 171550) * 0.33;
         else
           tax = 8350 * 0.10 + (33950 - 8350) * 0.15 +
           (82250 - 33950) * 0.25 + (171550 - 82250) * 0.28 +
           (372950 - 171550) * 0.33 + (income - 372950) * 0.35;
             }
      break;
      case 1:{      //file married or Widow  
          if (income &lt;= 16700)
            tax = income * 0.10;
          else if(income &lt;= 67900)
             tax = 16700 * .10 + (income - 16700) * .15;
          else if (income &lt;= 137050)
              tax = 16700 * .10 + (67900 - 16700) * .15 + (income - 137050) * .25;
          else if (income &lt;= 208850)
              tax = 16700 * .10 + (67900 - 16700) * .15 + (137050 - 67900) *  .25 + 
                      (income - 208850) * .28;
          else if (income &lt;= 372950)
              tax = 16700 * .10 + (67900 - 16700) * .15 + (137050 - 67900)  * .25 + 
                      (208850 - 137050) * .28 + (income - 372950) * .33;
          else
              tax =  16700 * .10 + (67900 - 16700) * .15 + (137050 - 67900) * .25 + 
                      (208850 - 137050) * .28 + (372950 - 208850) * .33 + (income - 372950) * .35;
      }
      break;
  
  }
  System.out.println("Your tax will be $" + tax);
  
  
  }
  </code></pre>
  
  <p>}</p>