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:
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
pa salah harusnayh x rpl 1
Nama : Danny Ariswara
Kelas : X RPL 3
Atos !!!!
pak udah , lumayan pusing.
nama ; citra marsha nabila
kelas ; xrpl2
bapak udah
nama ; nurhaeni
kelas ; xrpl2
bapak ini udah
nama ; ami nurgantini
kelas ; xrpl2
beres..
nama ; irma fitriyani
kelas ; xrpl2
bapak udah beres
nama ; susan susanti
kelas ; xrpl2
pak udah beres
nama : andriansyah
kelas : xrpl2
pak udah
nama : anggi kurnia
kelas : xrpl2
nama:mila karmila
kelas;x rpl 1
sudah pak
Iqbal Khairuddin S
X RPL 1
Bisa pak.
pak udah selesai
nama : ridwan maulana
Kelas : X RPL 3
Ardy Adriansyah
X RPL 1
Posting Komentar