The Sims 3 - New Real House

Pemrograman 1



Public Class Kasus_1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
        MsgBox("Hasil dari" & " " & TextBox1.Text & "+" & TextBox2.Text & " " & "adalah" & " " & TextBox3.Text & "")
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
        MsgBox("Hasil dari" & " " & TextBox1.Text & "-" & TextBox2.Text & " " & "adalah" & " " & TextBox3.Text & "")
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
        MsgBox("Hasil dari" & " " & TextBox1.Text & "x" & TextBox2.Text & " " & "adalah" & " " & TextBox3.Text & "")
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
        MsgBox("Hasil dari" & " " & TextBox1.Text & ":" & TextBox2.Text & " " & "adalah" & " " & TextBox3.Text & "")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox3.Text = Val(TextBox1.Text) Mod Val(TextBox2.Text)
        MsgBox("Hasil dari" & " " & TextBox1.Text & " " & "mod" & " " & TextBox2.Text & " " & "adalah" & " " & TextBox3.Text & "")
    End Sub
End Class

Komentar