- Back to Home »
- Kuliah »
- Contoh Aplikasi Kasir Cafe Menggunakan VB 6
Posted by : Anonim
Sabtu, 08 Juni 2013
Setelah cari referensi sana-sini akhirnya jadi juga.
Untuk memenuhi salah satu tugas MK Teknik Pemrograman, yaitu membuat suatu aplikasi dengan VB 6.
Karena masih bener-bener awam yaa jadi bikin yang sederhana ajaa..
Ini Tampilan programnya :
Private Sub bayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
kembali = Val(bayar) - Val(totalharga)
Command1.SetFocus
If kembali.Text < 0 Then
kembali.Text = ""
bayar.Text = ""
P = MsgBox("Uang Kurang, Silahkan Input Ulang", vbCritical, "Error")
bayar.SetFocus
End If
End If
End Sub
Private Sub Checkair_Click()
If Checkteh = 1 And Checkair = 0 And Checkjus = 0 Then
hargaminum = 2000
Else
If Checkteh = 1 And Checkair = 1 And Checkjus = 0 Then
hargaminum = 2500
Else
If Checkteh = 1 And Checkair = 1 And Checkjus = 1 Then
hargaminum = 6500
Else
If Checkteh = 0 And Checkair = 1 And Checkjus = 0 Then
hargaminum = 500
Else
If Checkteh = 0 And Checkair = 1 And Checkjus = 1 Then
hargaminum = 4500
Else
If Checkteh = 0 And Checkair = 0 And Checkjus = 1 Then
hargaminum = 4000
Else
If Checkteh = 1 And Checkair = 0 And Checkjus = 1 Then
hargaminum = 6000
Else
hargaminum = 0
End If
End If
End If
End If
End If
End If
End If
End Sub
Private Sub Checkjus_Click()
If Checkteh = 1 And Checkair = 0 And Checkjus = 0 Then
hargaminum = 2000
Else
If Checkteh = 1 And Checkair = 1 And Checkjus = 0 Then
hargaminum = 2500
Else
If Checkteh = 1 And Checkair = 1 And Checkjus = 1 Then
hargaminum = 6500
Else
If Checkteh = 0 And Checkair = 1 And Checkjus = 0 Then
hargaminum = 500
Else
If Checkteh = 0 And Checkair = 1 And Checkjus = 1 Then
hargaminum = 4500
Else
If Checkteh = 0 And Checkair = 0 And Checkjus = 1 Then
hargaminum = 4000
Else
If Checkteh = 1 And Checkair = 0 And Checkjus = 1 Then
hargaminum = 6000
Else
hargaminum = 0
End If
End If
End If
End If
End If
End If
End If
End Sub
Private Sub Checkteh_Click()
If Checkteh = 1 And Checkair = 0 And Checkjus = 0 Then
hargaminum = 2000
Else
If Checkteh = 1 And Checkair = 1 And Checkjus = 0 Then
hargaminum = 2500
Else
If Checkteh = 1 And Checkair = 1 And Checkjus = 1 Then
hargaminum = 6500
Else
If Checkteh = 0 And Checkair = 1 And Checkjus = 0 Then
hargaminum = 500
Else
If Checkteh = 0 And Checkair = 1 And Checkjus = 1 Then
hargaminum = 4500
Else
If Checkteh = 0 And Checkair = 0 And Checkjus = 1 Then
hargaminum = 4000
Else
If Checkteh = 1 And Checkair = 0 And Checkjus = 1 Then
hargaminum = 6000
Else
hargaminum = 0
End If
End If
End If
End If
End If
End If
End If
End Sub
Private Sub Combopaket_Click()
If Combomenu.Text = "Sarapan Pagi" Then
Select Case (Combopaket.Text)
Case "Paket 1"
Listmenu.Clear
Listmenu.AddItem ("Nasi Uduk")
Listmenu.AddItem ("Telur")
Listmenu.AddItem ("Tempe Orek")
hargamakan = 5000
Case Else
Listmenu.Clear
Listmenu.AddItem ("Nasi Goreng")
Listmenu.AddItem ("Telur")
Listmenu.AddItem ("Tempe Goreng")
hargamakan = 7000
End Select
Else
Select Case (Combopaket.Text)
Case "Paket 1"
Listmenu.Clear
Listmenu.AddItem ("Nasi Putih")
Listmenu.AddItem ("Ayam Bakar")
Listmenu.AddItem ("Lalapan")
hargamakan = 8000
Case Else
Listmenu.Clear
Listmenu.AddItem ("Nasi Putih")
Listmenu.AddItem ("Rendang")
Listmenu.AddItem ("Sayuran")
Listmenu.AddItem ("Tempe Goreng")
hargamakan = 10000
End Select
End If
End Sub
Private Sub Command1_Click()
Me.Combomenu.Clear
Me.Combomenu.Text = "Pilih Menu"
Me.Combopaket.Clear
Me.Combopaket.Text = "Pilih Paket"
Me.Listmenu.Clear
Me.hargamakan.Text = ""
Me.hargaminum = ""
Me.hargalay = ""
Me.jumlahbeli = ""
Me.totalharga = ""
Me.bayar = ""
Me.kembali = ""
Me.Checkteh = False
Me.Checkair = False
Me.Checkjus = False
Me.Option1 = False
Me.Option2 = False
Combomenu.AddItem ("Sarapan Pagi")
Combomenu.AddItem ("Makan Siang")
Combopaket.AddItem ("Paket 1")
Combopaket.AddItem ("Paket 2")
End Sub
Private Sub Command2_Click()
X = MsgBox("Anda Mau Keluar?", vbQuestion + vbOKCancel, "Attention")
If X = vbOK Then
End
End If
End Sub
Private Sub Form_Load()
Combomenu.AddItem ("Sarapan Pagi")
Combomenu.AddItem ("Makan Siang")
Combopaket.AddItem ("Paket 1")
Combopaket.AddItem ("Paket 2")
End Sub
Private Sub jumlahbeli_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
totalharga = Val(jumlahbeli) * (Val(hargamakan) + Val(hargaminum)) + Val(hargalay)
bayar.SetFocus
End If
End Sub
Private Sub Option1_Click()
hargalay = 5000
Option2 = False
End Sub
Private Sub Option2_Click()
hargalay = 0
Option1 = False
End Sub
Private Sub Timer1_Timer()
Time.Caption = Format(Now, "dddd/dd mm yyyy/hh:mm:ss")
End Sub
Demikian, :)
IF