1. Strategi
Prosedur proses dalam program sinulasi penjualan ini, yaitu :
- Stok awal yaitu 1.
- Pelanggan dibuat random, jadi setiap harinya pelanggan yang datang maksimal 1 pelanggan.
- Pemesanan barang dilakukan setiap barang tesebut telah dipesan oleh pelanggan dan dilihat dari jumlah stok minimum.
- Program simulasi menghitung jumlah pelanggan, pelanggan yang dilayani dan tidak dilayani, serta persentase setiap minggunya beserta jumlah keseluruhan.
- Persentase keseluruhan dihitung dari jumlah total pelanggan yang dilayani berbanding lurus dengan jumlah pelanggan yang datang.
2. Analisis Hasil
Berdasarkan hasil analisis dari program simulasi penjualan ini, persentase keseluruhan berada diatas 70%. Rata-rata kedatangan pelanggan (a) yaitu :1/3 Misalkan jumlah minggu yang akan dihitung adalah 12 minggu.
Gambar 1. Tampilan ketika proses 1 dijalankan
Keterangan Proses 1
Sisa stok = 0
Total pelanggan = 45
Total dilayani = 37
Total tidak dilayani = 8
Persentase keseluruhan = 82 %
Keterangan Proses 2
Sisa stok = 2
Total pelanggan = 40
Total dilayani = 35
Total tidak dilayani = 5
Persentase keseluruhan = 87 %
Gambar 3. Tampilan ketika proses 3 dijalankan
Keterangan Proses 3
Sisa stok = 0
Total pelanggan = 49
Total dilayani = 39
Total tidak dilayani = 10
Persentase keseluruhan = 79 %
4. Source Code
4. Source Code
Source code form utama:
Dim a As Double
Dim stok As Integer
Dim pelanggan As Integer
Dim pesan As Integer
Dim dilayani As Integer
Dim tdkdilayani As Integer
Dim persentase As Double
Dim persentase_per_minggu As Double
Dim tot_dilayani, totaldilayani As Integer
Dim tot_tdkdilayani, totaltdkdilayani As Integer
Dim tot_pelanggan, totalpelanggan As Integer
Dim hari_pesan, minggu As Integer
Dim random_pelanggan As Integer
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdmulai_Click()
Dim jum_minggu As Integer
Dim hari As Integer
a = 1 / 3
hari_pesan = 1
stok = 1
pesan = -1
tot_pelanggan = 0
tot_dilayani = 0
tot_tdkdilayani = 0
totalpelanggan = 0
totaldilayani = 0
totaltdkdilayani = 0
txtpersentase = ""
mxdaftar.Rows = 1
If txtminggu = "" Then
MsgBox "Masukkan jumlah minggu", vbInformation, "Pemberitahuan"
txtstok = ""
txtpelanggan = ""
txtdilayani = ""
txttdkdilayani = ""
Exit Sub
Else
minggu = txtminggu
End If
For jum_minggu = 1 To minggu
For hari = 1 To 7
dilayani = 0
tdkdilayani = 0
If pesan = 0 Then
stok = stok + 1
End If
If pesan >= 0 Then
pesan = pesan - 1
End If
If stok <= 1 Then
If pesan < 0 Then
pesan = hari_pesan
End If
End If
random_pelanggan = Rnd(1)
If random_pelanggan < a Then
pelanggan = 1
Else
pelanggan = 0
End If
If pelanggan = 1 Then
If stok > 0 Then
dilayani = dilayani + 1
stok = stok - 1
If pesan < 0 Then
pesan = hari_pesan
End If
Else
tdkdilayani = tdkdilayani + 1
End If
End If
tot_pelanggan = tot_pelanggan + pelanggan
tot_dilayani = tot_dilayani + dilayani
tot_tdkdilayani = tot_tdkdilayani + tdkdilayani
txtpelanggan = tot_pelanggan
txtdilayani = tot_dilayani
txttdkdilayani = tot_tdkdilayani
txtstok = stok
DoEvents
Next
DoEvents
If tot_pelanggan = 0 Then
persentase_per_minggu = 0
Else
persentase_per_minggu = tot_dilayani / tot_pelanggan * 100
End If
mxdaftar.Rows = mxdaftar.Rows + 1
mxdaftar.TextMatrix(jum_minggu, 0) = jum_minggu
mxdaftar.TextMatrix(jum_minggu, 1) = tot_pelanggan
mxdaftar.TextMatrix(jum_minggu, 2) = tot_dilayani
mxdaftar.TextMatrix(jum_minggu, 3) = tot_tdkdilayani
mxdaftar.TextMatrix(jum_minggu, 4) = Int(persentase_per_minggu)
mxdaftar.TextMatrix(jum_minggu, 5) = stok
totalpelanggan = totalpelanggan + tot_pelanggan
totaldilayani = totaldilayani + tot_dilayani
totaltdkdilayani = totaltdkdilayani + tot_tdkdilayani
tot_pelanggan = 0
tot_dilayani = 0
tot_tdkdilayani = 0
Next
DoEvents
txtpelanggan = totalpelanggan
txtdilayani = totaldilayani
txttdkdilayani = totaltdkdilayani
persentase = totaldilayani / totalpelanggan * 100
txtpersentase = Int(persentase)
txtstok = stok
End Sub
Private Sub Command1_Click()
frmabout.Show (1)
Private Sub Form_Load()
With Me
.Top = (Screen.Height - .Height) / 2
.Left = (Screen.Width - .Width) / 2
End With
With mxdaftar
.TextMatrix(0, 0) = "Minggu ke-"
.TextMatrix(0, 1) = "Pelanggan"
.TextMatrix(0, 2) = "Dilayani"
.TextMatrix(0, 3) = "Tidak Dilayani"
.TextMatrix(0, 4) = "Persentase per Minggu (%)"
.TextMatrix(0, 5) = "Stok"
End With
End Sub
Private Sub txtminggu_GotFocus()
txtminggu = ""
End Sub
Private Sub txtminggu_KeyPress(KeyAscii As Integer)
Call OnlyNUMERIC(KeyAscii)
End Sub
Makasih gan..sangat membantu
ReplyDelete