tugas 8

 

gambar tipe H
Private Sub Cbokode_Click()
Dim jk, hs, HB As Integer
Select Case Cbokode.Text
Case “P205”
jk = “Pentium II 500 Mega Hz”
hs = “1500000”
Case “P308”
jk = “Pentium III 800 Mega Hz”
hs = “2100000”
Case “P310”
jk = “Pentium III 1.0 Mega Hz”
hs = “3500000”
Case “P415”
jk = “Pentium IV 1.5 Mega Hz”
hs = “4000000”
Case “P417”
jk = “Pentium IV 1.7 Mega Hz”
hs = “4200000”
Case “P419”
jk = “Pentium IV 1.9 Mega Hz”
hs = “5500000”
End Select
Txtjk.Text = jk
Txths.Text = hs
Txtbayar.SetFocus

End Sub

Private Sub Cmdhitunglagi_Click()
Cbokode.SetFocus
Cbokode.Text = “”
Txtjk.Text = “”
Txths.Text = “”
Txtjj.Text = “”
Txthp.Text = “”
Txtdiskon.Text = “”
Txtbayar.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
End
End Sub

Private Sub cmdproses_Click()
Txthp.Text = Val(Txths) * Val(Txtjj)
Select Case Txthp.Text
Case Is > 40000000
Txtdiskon.Text = Val(Txthp) * 0.15
Case Is > 35000000
Txtdiskon.Text = Val(Txthp) * 0.1
Case Is > 30000000
Txtdiskon.Text = Val(Txthp) * 0.05
Case Is > 25000000
Txtdiskon.Text = Val(Txthp) * 0.02
End Select
Txtbayar.Text = Val(Txthp) – Val(Txtdiskon)

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

Private Sub Txtjj_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txthp.Text = Val(Txthp) * Val(Txtjj)
Select Case Txthp.Text
Case Is > 40000000
Txtdiskon.Text = Val(Txthp) * 0.15
Case Is > 35000000
Txtdiskon.Text = Val(Txthp) * 0.1
Case Is > 30000000
Txtdiskon.Text = Val(Txthp) * 0.05
Case Is > 25000000
Txtdiskon.Text = Val(Txthp) * 0.02
End Select
Txtbayar.Text = Val(Txthp) – Val(Txtdiskon)
End If

End Sub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s