This document contains code for 3 different activities - Activity 4A, Activity 4B, and a lab exercise for Lab 4. Activity 4A includes code to calculate a total amount based on quantity and unit price and clear fields. Activity 4B includes code to calculate car rental costs based on start/end km and days rented. The lab exercise includes code to calculate total cost after a 10% discount and remaining balance.
This document contains code for 3 different activities - Activity 4A, Activity 4B, and a lab exercise for Lab 4. Activity 4A includes code to calculate a total amount based on quantity and unit price and clear fields. Activity 4B includes code to calculate car rental costs based on start/end km and days rented. The lab exercise includes code to calculate total cost after a 10% discount and remaining balance.
This document contains code for 3 different activities - Activity 4A, Activity 4B, and a lab exercise for Lab 4. Activity 4A includes code to calculate a total amount based on quantity and unit price and clear fields. Activity 4B includes code to calculate car rental costs based on start/end km and days rented. The lab exercise includes code to calculate total cost after a 10% discount and remaining balance.
This document contains code for 3 different activities - Activity 4A, Activity 4B, and a lab exercise for Lab 4. Activity 4A includes code to calculate a total amount based on quantity and unit price and clear fields. Activity 4B includes code to calculate car rental costs based on start/end km and days rented. The lab exercise includes code to calculate total cost after a 10% discount and remaining balance.
End End Sub Private Sub cmdKira_Click() Dim Kuantiti As Integer Dim Unit As Double Dim Jmlah As Double Kuantiti = Val(txtKuantii.Text) Unit = Val(txtUnit.Text) Jumlah = Unit * Kuantiti lblJumlah.Caption = Jumlah End Sub Private Sub cmdKosongkan_Click() txtUnit.Text = "" txtKuantii.Text = "" lblJumlah.Caption = "" txtKuantii.SetFocus End Sub ANTARAMUKA
AKTIVITI 4B Private Sub cmdExit_Click() End End Sub
Private Sub cmdKiraSewa_Click()
Dim Awal, Akhir, JumlahKM, SewaKereta, SewaHari, JUMLAH As Double Dim BilHari As Integer Awal = Val(txtAwal.Text) Akhir = Val(txtAkhir.Text) BilHari = Val(txtBilHari.Text) JumlahKM = Akhir - Awal lblJumKM.Caption = JumlahKM SewaKereta = JumlahKM * 0.5 lblSewaKereta.Caption = SewaKereta SewaHari = BilHari * 20 lblSewaHari.Caption = SewaHari JUMLAH = SewaHari + SewaKereta lblJUMLAH.Caption = JUMLAH End Sub Private Sub cmdKosongkan_Click() txtAwal.Text = "" txtAkhir.Text = "" lblJumKM.Caption = "" lblSewaKereta.Caption = "" txtBilHari.Text = "" lblSewaHari.Caption = "" lblJUMLAH.Caption = ""
ANTARAMUKA
LATIHAN AMALI LAB 4
Private Sub cmdKira_Click() Dim Harga As Double Dim JumItem As Integer Dim HargaSelepasDiskaun, Tunai, Baki As Double Harga = Val(txtHarga.Text) JumItem = Val(txtJumItem.Text) Tunai = Val(txtTunai.Text) JumHarga = Harga * JumItem lblJumHarga.Caption = JumHarga HargaSelepasDiskaun = JumHarga - (JumHarga * 0.1) lblHargaSelepasDiskaun.Caption = HargaSelepasDiskaun Baki = Tunai - HargaSelepasDiskaun lblBaki.Caption = Format$(Baki, "currency") End Sub ANTARAMUKA