[問題] 有關C#的變數宣告問題...
不知道可以在這裡發問嗎?
如果不適合的話就請提省 我會自D 或是版大幫忙一下了...
這是一支簡單要算所得稅的程式
現在問題是不知道要宣告變數tax為什麼類型...
我只知道 string tax = ""; (是這樣寫)
double tax = ;
︿︿︿︿︿︿︿? 現在就是這行不知道後面要填啥....
請知道的高手回答一下好嗎...
很蠢的新手問題...感謝~
這是整隻程式...
Console.Write("請輸入淨所得:");
string i = Console.ReadLine();
int income = int.Parse(i);
if (income <= 300000)
tax = income*0.06;
else
if (income <= 800000)
tax = (income-300000)*0.13+30000*0.06;
else
if (income <= 2000000)
tax = (income-1100000)*0.21+500000*0.13+300000*0.06;
else
if (income > 2000000)
tax = (income-2000000)*0.3+900000*0.21+500000*0.13+300000*0.06;
Console.WriteLine("您的所得稅為:{0}",tax);
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.7.59
推
03/27 16:59, , 1F
03/27 16:59, 1F
推
03/29 23:32, , 2F
03/29 23:32, 2F