Public Class Form1
'主程式
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MsgBox(ymoney(10, "大學", "主管"))
MsgBox(ymoney(2, "大學", "職員"))
End Sub
'函式
Function ymoney(ByVal yy, ByVal gr, ByVal pr)
If yy < 5 Then
ymoney = 3000
Else
ymoney = 5000
End If
If gr = "大學" Then
ymoney = ymoney + 5000
Else
ymoney = ymoney + 2000
End If
If pr = "主管" Then
ymoney = ymoney + 10000
End If
End Function
End Class
沒有留言:
張貼留言