Selasa, 01 Maret 2011

Tugas Praktikum 1 TPT (VB.Net)

Tugas Praktikum 1 TPT  no. 1


Output :

 

Syntax
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Clear()
        TextBox2.Clear()
        TextBox3.Clear()
        RadioButton1.Checked = False
        RadioButton2.Checked = False
        RadioButton3.Checked = False
        RadioButton4.Checked = False

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim a, b As Integer
        a = CInt(TextBox1.Text)
        b = CInt(TextBox2.Text)
      
        If RadioButton1.Checked = True Then
            TextBox3.Text = CStr(a / b)
        ElseIf RadioButton2.Checked = True Then
            TextBox3.Text = CStr(a Mod b)
        ElseIf RadioButton3.Checked = True Then
            TextBox3.Text = CStr(a ^ b)
        ElseIf RadioButton4.Checked = True Then
            TextBox3.Text = CStr(a & b)
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Application.Exit()

    End Sub
End Class


nb : barangkali ada yang belum paham boleh tanya disini :)

Tidak ada komentar:

Posting Komentar