JUDUL SOAL : Tugas Praktikum PENJUALAN KREDIT MOBIL (Pelajaran di Kelas)
Desain Program
Berikut Jawaban Program :
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call buattabel()
kode.Items.Add("MB1")
kode.Items.Add("MB2")
kode.Items.Add("MB3")
kode.Items.Add("MB4")
For i = 2012 To 2014
tahun.Items.Add(i)
Next
kondisi.Items.Add("Baru")
kondisi.Items.Add("Bekas")
For y = 12 To 48
lamakredit.Items.Add(y)
Next
End Sub
Sub isitable()
Dim x As New ListViewItem
x.Text = kode.Text
x.SubItems.Add(Npembeli.Text)
x.SubItems.Add(merekmobil.Text)
x.SubItems.Add(tahun.Text)
x.SubItems.Add(kondisi.Text)
x.SubItems.Add(Harga.Text)
x.SubItems.Add(jumlah.Text)
x.SubItems.Add(tharga.Text)
x.SubItems.Add(uangmuka.Text)
x.SubItems.Add(ksales.Text)
x.SubItems.Add(totalkredit.Text)
x.SubItems.Add(lamakredit.Text)
x.SubItems.Add(aperbulan.Text)
Lv.Items.Add(x)
End Sub
Sub buattabel()
LV.Columns.Add("Kode Pembeli", 80, HorizontalAlignment.Center)
LV.Columns.Add("Nama Pembeli", 80, HorizontalAlignment.Center)
LV.Columns.Add("Merek Mobil", 120, HorizontalAlignment.Center)
LV.Columns.Add("Tahun Keluaran", 100, HorizontalAlignment.Center)
LV.Columns.Add("Kondisi", 80, HorizontalAlignment.Center)
LV.Columns.Add("Harga", 100, HorizontalAlignment.Center)
LV.Columns.Add("Jumlah Beli", 120, HorizontalAlignment.Center)
LV.Columns.Add("Total Harga", 120, HorizontalAlignment.Center)
LV.Columns.Add("Uang Muka", 120, HorizontalAlignment.Center)
LV.Columns.Add("Komisi Sales", 120, HorizontalAlignment.Center)
LV.Columns.Add("Total Kredit", 120, HorizontalAlignment.Center)
LV.Columns.Add("Lama Kredit", 140, HorizontalAlignment.Center)
LV.Columns.Add("Angsuran Per Bulan", 180, HorizontalAlignment.Center)
Lv.View = View.Details
Lv.GridLines = True
Lv.FullRowSelect = True
End Sub
Private Sub kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kode.SelectedIndexChanged
If kode.Text = "MB1" Then
merekmobil.Text = "AVANZA VELOZ"
ElseIf kode.Text = "MB2" Then
merekmobil.Text = "AVANZA G"
ElseIf kode.Text = "MB3" Then
merekmobil.Text = "XENIA G"
ElseIf kode.Text = "MB4" Then
merekmobil.Text = "YARIS"
End If
If kode.Text = "MB1" Then
Npembeli.Text = "Yefani Filliang"
ElseIf kode.Text = "MB2" Then
Npembeli.Text = "Cherly Anggreani"
ElseIf kode.Text = "MB3" Then
Npembeli.Text = "Dead Trunk"
ElseIf kode.Text = "MB4" Then
Npembeli.Text = "Gio Fernando"
End If
End Sub
Private Sub kondisi_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kondisi.SelectedIndexChanged
If kode.Text = "MB1" And merekmobil.Text = "AVANZA VELOZ" And tahun.Text = "2012" And kondisi.Text = "Baru" Then
harga.Text = "175000000"
ElseIf kode.Text = "MB1" And merekmobil.Text = "AVANZA VELOZ" And tahun.Text = "2012" And kondisi.Text = "Bekas" Then
harga.Text = "120000000"
ElseIf kode.Text = "MB1" And merekmobil.Text = "AVANZA VELOZ" And tahun.Text = "2013" And kondisi.Text = "Baru" Then
harga.Text = "195000000"
ElseIf kode.Text = "MB1" And merekmobil.Text = "AVANZA VELOZ" And tahun.Text = "2013" And kondisi.Text = "Bekas" Then
harga.Text = "130000000"
ElseIf kode.Text = "MB1" And merekmobil.Text = "AVANZA VELOZ" And tahun.Text = "2014" And kondisi.Text = "Baru" Then
harga.Text = "208000000"
ElseIf kode.Text = "MB1" And merekmobil.Text = "AVANZA VELOZ" And tahun.Text = "2014" And kondisi.Text = "Bekas" Then
harga.Text = "170000000"
ElseIf kode.Text = "MB2" And merekmobil.Text = "AVANZA G" And tahun.Text = "2012" And kondisi.Text = "Baru" Then
harga.Text = "189000000"
ElseIf kode.Text = "MB2" And merekmobil.Text = "AVANZA G" And tahun.Text = "2012" And kondisi.Text = "Bekas" Then
harga.Text = "150000000"
ElseIf kode.Text = "MB2" And merekmobil.Text = "AVANZA G" And tahun.Text = "2013" And kondisi.Text = "Baru" Then
harga.Text = "200000000"
ElseIf kode.Text = "MB2" And merekmobil.Text = "AVANZA G" And tahun.Text = "2013" And kondisi.Text = "Bekas" Then
harga.Text = "180000000"
ElseIf kode.Text = "MB2" And merekmobil.Text = "AVANZA G" And tahun.Text = "2014" And kondisi.Text = "Baru" Then
harga.Text = "250000000"
ElseIf kode.Text = "MB2" And merekmobil.Text = "AVANZA G" And tahun.Text = "2014" And kondisi.Text = "Bekas" Then
harga.Text = "200000000"
ElseIf kode.Text = "MB3" And merekmobil.Text = "XENIA G" And tahun.Text = "2012" And kondisi.Text = "Baru" Then
harga.Text = "252000000"
ElseIf kode.Text = "MB3" And merekmobil.Text = "XENIA G" And tahun.Text = "2012" And kondisi.Text = "Bekas" Then
harga.Text = "190000000"
ElseIf kode.Text = "MB3" And merekmobil.Text = "XENIA G" And tahun.Text = "2013" And kondisi.Text = "Baru" Then
harga.Text = "2350000000"
ElseIf kode.Text = "MB3" And merekmobil.Text = "XENIA G" And tahun.Text = "2013" And kondisi.Text = "Bekas" Then
harga.Text = "195000000"
ElseIf kode.Text = "MB3" And merekmobil.Text = "XENIA G" And tahun.Text = "2014" And kondisi.Text = "Baru" Then
harga.Text = "275000000"
ElseIf kode.Text = "MB3" And merekmobil.Text = "XENIA G" And tahun.Text = "2014" And kondisi.Text = "Bekas" Then
harga.Text = "225000000"
ElseIf kode.Text = "MB4" And merekmobil.Text = "YARIS" And tahun.Text = "2012" And kondisi.Text = "Baru" Then
harga.Text = "175000000"
ElseIf kode.Text = "MB4" And merekmobil.Text = "YARIS" And tahun.Text = "2012" And kondisi.Text = "Bekas" Then
harga.Text = "120000000"
ElseIf kode.Text = "MB4" And merekmobil.Text = "YARIS" And tahun.Text = "2013" And kondisi.Text = "Baru" Then
harga.Text = "1900000000"
ElseIf kode.Text = "MB4" And merekmobil.Text = "YARIS" And tahun.Text = "2013" And kondisi.Text = "Bekas" Then
harga.Text = "145000000"
ElseIf kode.Text = "MB4" And merekmobil.Text = "YARIS" And tahun.Text = "2014" And kondisi.Text = "Baru" Then
harga.Text = "160000000"
ElseIf kode.Text = "MB4" And merekmobil.Text = "YARIS" And tahun.Text = "2014" And kondisi.Text = "Bekas" Then
harga.Text = "120000000"
End If
End Sub
Private Sub jumlahbeli_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jumlah.KeyPress
If Asc(e.KeyChar) = 13 Then
tharga.Text = jumlah.Text * harga.Text
uangmuka.Text = 0.3 * tharga.Text
ksales.Text = 0.02 * Val(jumlah.Text + uangmuka.Text)
totalkredit.Text = Val(tharga.Text) - Val(uangmuka.Text)
End If
End Sub
Private Sub proses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Proses.Click
aperbulan.Text = Val(totalkredit.Text) * Val(0.03 * lamakredit.Text) + Val(totalkredit.Text / lamakredit.Text)
End Sub
Private Sub simpandata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
isitable()
Call bersih()
kode.Focus()
End Sub
Private Sub hapuslist_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HapusList.Click
LV.Items.Clear()
End Sub
Private Sub hapuskode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapusperkode.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub Batal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Batal.Click
Call bersih()
End Sub
Sub bersih()
kode.Text = ""
Npembeli.Text = ""
merekmobil.Text = ""
tahun.Text = ""
kondisi.Text = ""
Harga.Text = ""
jumlah.Text = ""
tharga.Text = ""
uangmuka.Text = ""
ksales.Text = ""
totalkredit.Text = ""
lamakredit.Text = ""
aperbulan.Text = ""
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
End
End Sub
End Class
Tampilan Jadi Program
Demikilahlah postingan saya Nama : (Indah Rosita Br. Bangun) NPM : (13111140)
Selamat Belajar Pemrograman VB NET
0 comments:
Post a Comment