Kamis, 09 Mei 2013

Latihan 4 Visual Basic - Operator Test

Latihan 4 Visual Basic - Operator Test



Dim var1 As Single, var2 As Single
Dim hasil As Single

Private Sub Form_Load()
    Text1.Text = ""
    Text2.Text = ""
    Label3.Caption = ""
End Sub

Private Sub Option1_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = var1 + var2
    Label3.Caption = hasil
End Sub

Private Sub Option2_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = var1 - var2
    Label3.Caption = hasil
End Sub

Private Sub Option3_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = var1 * var2
    Label3.Caption = hasil
End Sub

Private Sub Option4_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = var1 / var2
    Label3.Caption = hasil
End Sub

Private Sub Option5_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = var1 & var2
    Label3.Caption = hasil
End Sub

Private Sub Option6_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = (var1 > var2)
    Label3.Caption = Format(hasil, "True/False")
End Sub

Private Sub Option7_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = (var1 < var2)
    Label3.Caption = Format(hasil, "True/False")
End Sub

Private Sub Option8_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = (var1 = var2)
    Label3.Caption = Format(hasil, "True/False")
End Sub

Private Sub Option9_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = (var1 <> var2)
    Label3.Caption = Format(hasil, "True/False")
End Sub

Private Sub Option10_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = (var1 >= var2)
    Label3.Caption = Format(hasil, "True/False")
End Sub

Private Sub Option11_Click()
    var1 = Text1.Text
    var2 = Text2.Text
    hasil = (var1 <= var2)
    Label3.Caption = Format(hasil, "True/False")
End Sub

Private Sub Option12_Click()
    var1 = IIf(Text1.Text = "True", -1, 0)
    hasil = Not (var1)
    Label3.Caption = Format(hasil, "True/False")
End Sub

Private Sub Option13_Click()
    var1 = IIf(Text1.Text = "True", -1, 0)
    var2 = IIf(Text2.Text = "True", -1, 0)
    hasil = (var1 Or var2)
    Label3.Caption = Format(hasil, "True/False")
End Sub

Private Sub Option14_Click()
    var1 = IIf(Text1.Text = "True", -1, 0)
    var2 = IIf(Text2.Text = "True", -1, 0)
    hasil = (var1 And var2)
    Label3.Caption = Format(hasil, "True/False")
End Sub



14 komentar:

Ilham Kurniawan Ependi X RPL 1 mengatakan...

Pak Beres Latihan 1 & 4 Remedial 1 pelajaran @Visual basic....

#ni passs her VB :D Kade pak aya anu sami sreungabdi...

@ANONYMOSE

X RPL 2

Ilham Kurniawan Ependi X RPL 1 mengatakan...

pa salah harusnayh x rpl 1

Unknown mengatakan...

Nama : Danny Ariswara
Kelas : X RPL 3

Atos !!!!

Anonim mengatakan...

pak udah , lumayan pusing.
nama ; citra marsha nabila
kelas ; xrpl2

Anonim mengatakan...

bapak udah
nama ; nurhaeni
kelas ; xrpl2

Anonim mengatakan...

bapak ini udah
nama ; ami nurgantini
kelas ; xrpl2

Anonim mengatakan...

beres..
nama ; irma fitriyani
kelas ; xrpl2

Anonim mengatakan...

bapak udah beres
nama ; susan susanti
kelas ; xrpl2

Anonim mengatakan...

pak udah beres

nama : andriansyah
kelas : xrpl2

Anonim mengatakan...

pak udah

nama : anggi kurnia
kelas : xrpl2

Anonim mengatakan...

nama:mila karmila
kelas;x rpl 1

sudah pak

iqbal khairuddin s mengatakan...

Iqbal Khairuddin S
X RPL 1

Bisa pak.

Ridwan Maulana mengatakan...

pak udah selesai

nama : ridwan maulana
Kelas : X RPL 3

ardyadrnsyh mengatakan...

Ardy Adriansyah
X RPL 1

Posting Komentar

 
Design by Wordpress Theme Template Blog Free | Bloggerized by Free Blogger Templates | coupon codes