302班

          java突擊隊(duì)
          posts - 151, comments - 74, trackbacks - 0, articles - 14
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理


          import javax.swing.JOptionPane;
          public class taxQuestion
          {
            public static void main(String[] args)
            {
             //輸入基準(zhǔn)值
             String statusString=JOptionPane.showInputDialog(null,"Enter the filing status:\n"+"(0-single filer,1-married jointly,\n)"+"2-married separately,3-head of household)","Input a status",JOptionPane.QUESTION_MESSAGE);
             int status=Integer.parseInt(statusString);
             //輸入收入値
             String incomeString=JOptionPane.showInputDialog(null,"Enter the taxable income:","Give me your money",JOptionPane.QUESTION_MESSAGE);
             Double income=Double.parseDouble(incomeString);
             double tax=0;
          if(status==0)
            {
             if(income<=1200)
              JOptionPane.showMessageDialog(null,"You should not pay for the tax!","The show of the result",JOptionPane.INFORMATION_MESSAGE);
             else if(income<=3000)
             {
              tax=(income-1200)*0.10;
             JOptionPane.showMessageDialog(null,"You should pay"+tax+"for the tax!","The show of the result",JOptionPane.INFORMATION_MESSAGE);
             }
             else if(income<=10000)
             {
              tax=(income-3000)*0.15;
              JOptionPane.showMessageDialog(null,"You should pay"+tax+"for the tax!","The show of the result",JOptionPane.INFORMATION_MESSAGE);
             }
             else if(income<300000)
             { 
               tax=(income-10000)*0.30;
               JOptionPane.showMessageDialog(null,"You should pay"+tax+"for the tax!","The show of the result",JOptionPane.INFORMATION_MESSAGE);
             }
             else
             {
               tax=(income-300000)*0.80;
               JOptionPane.showMessageDialog(null,"You should pay"+tax+"for the tax!","The show of the result",JOptionPane.INFORMATION_MESSAGE);
             }
            }
             else
             {
               tax=(income-status);
              JOptionPane.showMessageDialog(null,"You should pay"+tax+"for the tax!","The show of the result",JOptionPane.INFORMATION_MESSAGE);
             }
           }
          }
          /////////////////////////////////////////////////////////////////////////
          測(cè)試結(jié)果簡(jiǎn)要如下:
          ////////////////////////////////////////////////////////////////////////




          主站蜘蛛池模板: 鄂伦春自治旗| 名山县| 平罗县| 时尚| 桃源县| 栾城县| 平陆县| 南安市| 昌乐县| 广灵县| 赤城县| 神木县| 岑巩县| 泰安市| 松原市| 盐源县| 武汉市| 徐水县| 丹棱县| 晋州市| 德州市| 蓝田县| 建平县| 攀枝花市| 浏阳市| 丁青县| 岫岩| 合肥市| 青海省| 宁城县| 巴彦县| 长寿区| 永福县| 吉隆县| 合作市| 桃江县| 平江县| 扶沟县| 宁德市| 商都县| 三都|