Anda di halaman 1dari 6

Jawaban Quiz Tipe A

Objek-objek yang terkait :


Objeck Properties Nilai
Form1 Caption Alga Musa Motor
Label1 Caption Alga Musa Motor
Data1 Name Motor
Caption Data Motor
Database Name Cari Difolder Masing2
Recordset Type 0-Table
Record Source Tbl_Motor
Frame1 Caption Pilihan Motor Yang Tersedia
label Caption Menu Pilihan
ComboBox1 Caption Combo1
Frame4 Caption Data Transaksi
Label2 Caption Jenis Motor
Label3 Caption Harga Motor
Label4 Caption Jumlah Beli
Label5 Caption Bayar
Label6 Caption Potongan
Label7 Caption Total Bayar
Text1 Name Text1
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text2 Name Text 2
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text3 Name Text 3
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text4 Name Text4
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text5 Name Text5
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text6 Name Text6
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
CommandButton1 Name Cmdtambah
Caption TAMBAH
CommandButton2 Name Cmdsimpan
Caption SIMPAN
CommandButton3 Name Cmdbatal
Caption BATAL
CommandButton4 Name Cmdhitung
Caption HITUNG
CommandButton5 Name Cmdkeluar
Caption KELUAR
Dbgrid1 Caption DATA TRANSAKSI
DataSource Motor

Listing Programnya:
Private Sub cmdbatal_Click()
MOTOR.Recordset.CancelUpdate
MOTOR.Recordset.MoveLast
End Sub

Private Sub cmdhapus_Click()


del = MsgBox("Record Mo Dihapus?", 36, "Konfirmasi")
If del = 6 Then
MOTOR.Recordset.Delete
MOTOR.Recordset.MoveLast
If MOTOR.Recordset.EOF Then
MOTOR.Recordset.MoveLast
End If
End If
End Sub

Private Sub cmdhitung_Click()


txtbayar.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
If txtjumlah > 5 Then
txtpotong.Text = 2 / 100 * Val(txtbayar.Text)
txttotal.Text = Val(txtbayar.Text) - Val(txtpotong.Text)
Else
txtpotong.Text = 0
txttotal = Val(txtbayar.Text) - Val(txtpotong.Text)
End If
End Sub

Private Sub cmdkeluar_Click()


psn = MsgBox("Anda Yakin Ingin Keluar", 32 + 4, "Informasi")
If psn = vbYes Then
MsgBox "Makasih Yach.........", 32, "informasi"
End
Else
If psn = vbNo Then
MsgBox "Lho.....kok enggak jadi toh", 32, "Informasi"
End If
End If
End Sub

Private Sub cmdsimpan_Click()


If tambah = True Then
MOTOR.Recordset.Update
Else
MOTOR.Recordset.Update
End If
End Sub
Private Sub cmdtambah_Click()
tambah = True
MOTOR.Recordset.AddNew
txtjenis.SetFocus
End Sub

Private Sub Combo1_CLICK()


If Combo1 = "SPR" Then
txtjenis = "SUPRA"
txtharga = 8000000
ElseIf Combo1 = "KRM" Then
txtjenis = "KARISMA"
txtharga = 8500000
ElseIf Combo1 = "LGD" Then
txtjenis = "LAGENDA"
txtharga = 8560000
ElseIf Combo1 = "WIN" Then
txtjenis = "HONDA WIN"
txtharga = 7500000
ElseIf Combo1 = "SHM" Then
txtjenis = "SMESH"
txtharga = 6500000
ElseIf Combo1 = "SGN" Then
txtjenis = "SHOGUN"
txtharga = 7800000
ElseIf Combo1 = "STR" Then
txtjenis = "SATRIA"
txtharga = 13000000
ElseIf Combo1 = "FGR" Then
txtjenis = "FEGA R"
txtharga = 12000000
ElseIf Combo1 = "JPR" Then
txtjenis = "JUPITER"
txtharga = 10000000
ElseIf Combo1 = "RXK" Then
txtjenis = "RX KING"
txtharga = 15000000
End If
End Sub

Private Sub Form_Load()


tambah = False
Combo1.AddItem "SPR"
Combo1.AddItem "KRM"
Combo1.AddItem "LGD"
Combo1.AddItem "WIN"
Combo1.AddItem "SHM"
Combo1.AddItem "SGN"
Combo1.AddItem "STR"
Combo1.AddItem "FGR"
Combo1.AddItem "JPR"
Combo1.AddItem "RXK"
End Sub
Private Sub txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub
Jawaban Quiz Tipe B

Objek-objek yang terkait :


Objeck Properties Nilai
Form1 Caption Alga Musa Motor
Label1 Caption Alga Musa Motor
Data1 Name Motor
Caption Data Motor
Database Name Cari Difolder Masing2
Recordset Type 0-Table
Record Source Tbl_Motor
Frame1 Caption Pilihan Motor Yang Tersedia
label Caption Menu Pilihan
List1 Caption List1
Frame4 Caption Data Transaksi
Label2 Caption Jenis Motor
Label3 Caption Harga Motor
Label4 Caption Jumlah Beli
Label5 Caption Bayar
Label6 Caption Potongan
Label7 Caption Total Bayar
Text1 Name Text1
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text2 Name Text 2
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text3 Name Text 3
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text4 Name Text4
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text5 Name Text5
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
Text6 Name Text6
DataSource Motor
DataField Sesuaikan dengan fieldnya masing2
Text <Kosongkan>
CommandButton1 Name Cmdtambah
Caption TAMBAH
CommandButton2 Name Cmdsimpan
Caption SIMPAN
CommandButton3 Name Cmdbatal
Caption BATAL
CommandButton4 Name Cmdhitung
Caption HITUNG
CommandButton5 Name Cmdkeluar
Caption KELUAR
Dbgrid1 Caption DATA TRANSAKSI
DataSource Motor

Listing Programnya:
Private Sub Form_Load()
tambah = False
List1.AddItem "SPR"
List1.AddItem "KRM"
List1.AddItem "LGD"
List1.AddItem "WIN"
List1.AddItem "SHM"
List1.AddItem "SGN"
List1.AddItem "STR"
List1.AddItem "FGR"
List1.AddItem "JPR"
List1.AddItem "RXK"
End Sub

Private Sub List1_Click()


If List1 = "SPR" Then
txtjenis = "SUPRA"
txtharga = 8000000
ElseIf List1 = "KRM" Then
txtjenis = "KARISMA"
txtharga = 8500000
ElseIf List1 = "LGD" Then
txtjenis = "LAGENDA"
txtharga = 8560000
ElseIf List1 = "WIN" Then
txtjenis = "HONDA WIN"
txtharga = 7500000
ElseIf List1 = "SHM" Then
txtjenis = "SMESH"
txtharga = 6500000
ElseIf List1 = "SGN" Then
txtjenis = "SHOGUN"
txtharga = 7800000
ElseIf List1 = "STR" Then
txtjenis = "SATRIA"
txtharga = 13000000
ElseIf List1 = "FGR" Then
txtjenis = "FEGA R"
txtharga = 12000000
ElseIf List1 = "JPR" Then
txtjenis = "JUPITER"
txtharga = 10000000
ElseIf List1 = "RXK" Then
txtjenis = "RX KING"
txtharga = 15000000
End If
End Sub
Private Sub cmdbatal_Click()
motor.Recordset.CancelUpdate
motor.Recordset.MoveLast
End Sub

Private Sub cmdhapus_Click()


del = MsgBox("Record Mo Dihapus?", 36, "Konfirmasi")
If del = 6 Then
motor.Recordset.Delete
motor.Recordset.MoveLast
If motor.Recordset.EOF Then
motor.Recordset.MoveLast
End If
End If
End Sub

Private Sub cmdhitung_Click()


txtbayar.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
If txtjumlah > 5 Then
txtpotong.Text = 2 / 100 * Val(txtbayar.Text)
txttotal.Text = Val(txtbayar.Text) - Val(txtpotong.Text)
Else
txtpotong.Text = 0
txttotal = Val(txtbayar.Text) - Val(txtpotong.Text)
End If
End Sub

Private Sub cmdkeluar_Click()


psn = MsgBox("Anda Yakin Ingin Keluar", 32 + 4, "Informasi")
If psn = vbYes Then
MsgBox "Makasih Yach.........", 32, "informasi"
End
Else
If psn = vbNo Then
MsgBox "Lho.....kok enggak jadi toh", 32, "Informasi"
End If
End If
End Sub

Private Sub cmdsimpan_Click()


If tambah = True Then
motor.Recordset.Update
Else
motor.Recordset.Update
End If
End Sub

Private Sub cmdtambah_Click()


tambah = True
motor.Recordset.AddNew
txtjenis.SetFocus
End Sub
Private Sub txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub