Membuat Program Zodiak Sederhana Menggunakan VB 06,
Apa kabar agan-agan semua, nih aku sedikit share project aku tiap minggu, bikin program yang inputnya nama, tanggal lahir terus outpunya akan kelihatan apa bintang or zodiaknya.
Programnya sederhana sesuai judulnya(hehe…) cuma nenggunakan percabangan IF dan Else. Namun di bagian penanggalan kita akan menggunakan DTPicker.
Oke langsunga aja ya dari pada kelamaan
Scriptnya kira-kira kaya gini gan
Dim tanggal As Date
Dim tglLhr, blnLhr As Integer
Dim panggil As String
Private Sub cmdCek_Click()
tanggal = Me.DTPicker1.Value
tglLhr = Day(tanggal)
blnLhr = Month(tanggal)
If (tglLhr >= 22 And blnLhr = 12) Or (tglLhr <= 20 And blnLhr = 1) Then
zodiak = “Capricorn”
ElseIf (tglLhr >= 21 And blnLhr = 1) Or (tglLhr <= 19 And blnLhr = 2) Then
zodiak = “Aquarius”
ElseIf (tglLhr >= 20 And blnLhr = 2) Or (tglLhr <= 20 And blnLhr = 3) Then
zodiak = “Pisces”
ElseIf (tglLhr >= 21 And blnLhr = 3) Or (tglLhr <= 19 And blnLhr = 4) Then
zodiak = “Aries”
ElseIf (tglLhr >= 20 And blnLhr = 4) Or (tglLhr <= 20 And blnLhr = 5) Then
zodiak = “Taurus”
ElseIf (tglLhr >= 21 And blnLhr = 5) Or (tglLhr <= 21 And blnLhr = 6) Then
zodiak = “Gemini”
ElseIf (tglLhr >= 22 And blnLhr = 6) Or (tglLhr <= 22 And blnLhr = 7) Then
zodiak = “Cancer”
ElseIf (tglLhr >= 23 And blnLhr = 7) Or (tglLhr <= 23 And blnLhr = 8) Then
zodiak = “Leo”
ElseIf (tglLhr >= 24 And blnLhr = 8) Or (tglLhr <= 22 And blnLhr = 9) Then
zodiak = “Virgo”
ElseIf (tglLhr >= 23 And blnLhr = 9) Or (tglLhr <= 23 And blnLhr = 10) Then
zodiak = “Libra”
ElseIf (tglLhr >= 24 And blnLhr = 10) Or (tglLhr <= 22 And blnLhr = 11) Then
zodiak = “Scorpio”
ElseIf (tglLhr >= 23 And blnLhr = 11) Or (tglLhr <= 21 And blnLhr = 12) Then
zodiak = “Sagitarius”
End If
Me.lblZodiak.Caption = zodiak
End Sub
Private Sub Form_Load()
End Sub
Komentar ini telah dihapus oleh pengarang.
BalasHapushttps://ubay37.blogspot.com/ Jangan Lupa kunjungi blog saya ya teman teman
BalasHapus