Selasa, 17 Februari 2015

Contoh program logika matematika menggunaka vb 6.0




keterangan :
command1(tombol konjungsi)
command2(tombol reset)
command3(tombol disjungsi)
command4(tombol implikasi)
command5(tombol biimplikasi)
command6(tombol keluar)


Source code

Private Sub Command1_Click()
If Text1.Text = "b" And Text2.Text = "b" Then
Text3.Text = "b"
Else
If Text1.Text = "b" And Text2.Text = "s" Then
Text3.Text = "s"
Else
If Text1.Text = "s" And Text2.Text = "s" Then
Text3.Text = "s"
Else
If Text1.Text = "s" And Text2.Text = "b" Then
Text3.Text = "s"
End If
End If
End If
End If
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""

End Sub

Private Sub Command3_Click()
If Text1.Text = "b" And Text2.Text = "b" Then
Text3.Text = "b"
Else
If Text1.Text = "b" And Text2.Text = "s" Then
Text3.Text = "b"
Else
If Text1.Text = "s" And Text2.Text = "s" Then
Text3.Text = "s"
Else
If Text1.Text = "s" And Text2.Text = "b" Then
Text3.Text = "b"
End If
End If
End If
End If
End Sub

Private Sub Command4_Click()
If Text1.Text = "b" And Text2.Text = "b" Then
Text3.Text = "b"
Else
If Text1.Text = "b" And Text2.Text = "s" Then
Text3.Text = "s"
Else
If Text1.Text = "s" And Text2.Text = "s" Then
Text3.Text = "b"
Else
If Text1.Text = "s" And Text2.Text = "b" Then
Text3.Text = "b"
End If
End If
End If
End If

End Sub

Private Sub Command5_Click()
If Text1.Text = "b" And Text2.Text = "b" Then
Text3.Text = "b"
Else
If Text1.Text = "b" And Text2.Text = "s" Then
Text3.Text = "s"
Else
If Text1.Text = "s" And Text2.Text = "b" Then
Text3.Text = "s"
Else
If Text1.Text = "s" And Text2.Text = "s" Then
Text3.Text = "b"
End If
End If
End If
End If
End Sub

Private Sub Command6_Click()
End
End Sub

Tidak ada komentar:

Posting Komentar