The Sims 3 - New Real House

Pemrograman 3


Nama TextBox 1 : nama
Nama TextBox 2 : upah
Nama TextBox 3 : jk
Nama TextBox 4 : gaji
Nama TextBox 5 : lmbr
Nama TextBox 6 : GB
Nama ComboBox 1 : gol



Public Class Kasus_2

    Private Sub gol_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gol.SelectedIndexChanged

        If gol.Text = "A" Then
            upah.Text = "5000"
        ElseIf gol.Text = "B" Then
            upah.Text = "6000"
        ElseIf gol.Text = "C" Then
            upah.Text = "7500"
        ElseIf gol.Text = "D" Then
            upah.Text = "9000"
        Else
            upah.Text = "0"
        End If
    End Sub

    Private Sub jk_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jk.TextChanged

        If Val(jk.Text) > 150 Then
            gaji.Text = Val(150) * Val(upah.Text)
            lmbr.Text = Val(jk.Text - 150) * Val(upah.Text)
            GB.Text = Val(gaji.Text) + Val(lmbr.Text)
        Else
            gaji.Text = Val(jk.Text) * Val(upah.Text)
            lmbr.Text = 0
            GB.Text = Val(gaji.Text) + Val(lmbr.Text)

        End If
    End Sub
End Class

Komentar