TUGAS 4

TUGAS 4 ADEL

Private Sub Cbokode_Click()
Dim jenis As String
Dim harga As Variant
Select Case CBOKODE.Text
Case “P205?”
jenis = “Pentium II 500 Mega Hz”
harga = 1500000
Case “P308?”
jenis = “Pentium III 800 Mega Hz”
harga = 2100000
Case “P310?”
jenis = “Pentium III 1.0 Giga Hz”
harga = 3500000
Case “P415?”
jenis = “Pentium IV 1.5 Giga Hz”
harga = 4000000
Case “P417?”
jenis = “Pentium IV 1.7 Giga Hz”
harga = 4200000
Case “P419?”
jenis = “Pentium IV 1.9 Giga Hz”
harga = 5500000
End Select
Txtjk.Text = jenis
Txths.Text = harga
Txtjj.SetFocus
End Sub
Private Sub Cmdproses_Click()
Txthp.Text = Val(Txtjj.Text) * Val(Txths.Text)
If Val(Txthp.Text) > 30000000 Then
Txtdiskon = Val(Txthp.Text) * 0.15
Txthb = Val(Txthp.Text) – Val(Txtdiskon.Text)
Else
If Val(Txthp.Text) > 25000000 Then
Txtdiskon = Val(Txthp.Text) * 0.1
Txthb = Val(Txthp.Text) – Val(Txtdiskon.Text)
Else
If Val(Txthp.Text) > 20000000 Then
Txtdiskon = Val(Txthp.Text) * 0.05
Txthb = Val(Txthp.Text) – Val(Txtdiskon.Text)
Else
If Val(Txthp.Text) > 15000000 Then
Txtdiskon = Val(Txthp.Text) * 0.02
Txthb = Val(Txthp.Text) – Val(Txtdiskon.Text)
End If
End If
End If
End If
End Sub
Private Sub Cmdlagi_Click()
CBOKODE.SetFocus
CBOKODE.Text = “”
Txtjk.Text = “”
Txths.Text = “”
Txtjj.Text = “”
Txthp.Text = “”
Txtdiskon.Text = “”
Txthb.Text = “”
End Sub
Private Sub Cmdkeluar_Click()
End
End Sub
Private Sub Form_Load()
CBOKODE.AddItem “P205?”
CBOKODE.AddItem “P308?”
CBOKODE.AddItem “P310?”
CBOKODE.AddItem “P415?”
CBOKODE.AddItem “P417?”
CBOKODE.AddItem “P419?”
End Sub

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s