最近才開始接觸VB
想做一個算綜合所得稅的程式
請問下如果要讓以下程式碼再輸入Y後可以重新計算
輸入N就離開的話要加入什麼指令??
還有如果要做成Windos Form的話該怎麼做??
目前的樣子
---------------------------------------------------------
Sub Main()
On Error Resume Next
Console.WriteLine("請輸入年收入:")
Dim money, cost As Integer
money = Console.ReadLine
If money <= 520000 Then
cost = money * 0.05
ElseIf money >= 520001 And money <= 1170000 Then
cost = (money * 0.12) - 36400
ElseIf money >= 1170001 And money <= 2350000 Then
cost = (money * 0.2) - 130000
ElseIf money >= 2350001 And money <= 4400000 Then
cost = (money * 0.3) - 365000
ElseIf money >= 4400001 Then
cost = (money * 0.4) - 805000
End If
Console.WriteLine("應繳金額: " & cost)
Console.WriteLine("")
Console.WriteLine("")
Console.WriteLine("是否重新輸入?(Y/N)")
End Sub
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: