Calculate taxes
Calculate taxes
題目說明
106年度課稅級距金額如下,請輸入所得薪額,計算該使用者所需負擔的綜所稅稅金並輸出結果(結果需取到小數點第一位)
級別 稅率 課稅級距(元)
1 5% 520,000 以下
2 12% 520,001 - 1,220,000
3 20% 1,220,001 - 1,920,000
4 30% 1,920,001 - 2,620,000
5 40% 2,620,001 以上
請輸入0至99,999,999的整數,若超出範圍須輸出wrong!
並結束執行 System.exit(0);
不須另外考慮免稅額或扣除額的部分。
若輸入為第三級別,所需繳納之綜所稅算法如下
稅金 = 520000*0.05+(1220000-520000)*0.12+(輸入值-1220000)*0.2
輸入資料限制:輸入數字都是正整數
輸入
所得薪額
輸出
稅金
Sample input1
234567
Sample output1
11728.4
Sample input2
-10
Sample output2
wrong!
Comments
輸出到第一位小數點:
System.out.printf("%.1f", 變數名稱);