tugas3

gambar c
Private Sub Cmdhitunglagi_Click()
Combo1.SetFocus
Combo1.Text = “”
Txtjenis.Text = “”
Txtharga.Text = “”
Txtjumlah.Text = “”
Txtharpen.Text = “”
Txtdiskon.Text = “”
Txtbayar.Text = “”
End Sub

Private Sub Cmdproses_Click()
Txtharpen.Text = Val(Txtharga) * Val(Txtjumlah)
Select Case Txtharpen.Text
Case Is > 30000000
Txtdiskon.Text = Val(Txtharpen) * 0.15
Case Is > 25000000
Txtdiskon.Text = Val(Txtharpen) * 0.1
Case Is > 20000000
Txtdiskon.Text = Val(Txtharpen) * 0.05
Case Is > 15000000
Txtdiskon.Text = Val(Txtharpen) * 0.02
End Select
Txtbayar.Text = Val(Txtharpen) – Val(Txtdiskon)
End Sub

Private Sub Combo1_Click()
Dim jk, hs, HB As Integer
Select Case Combo1.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
Txtjenis.Text = jk
Txtharga.Text = hs
Txtjumlah.SetFocus
End Sub

Private Sub Form_Load()
Combo1.AddItem “P205”
Combo1.AddItem “P308”
Combo1.AddItem “P310”
Combo1.AddItem “P415”
Combo1.AddItem “P417”
Combo1.AddItem “P419”
End Sub

Private Sub Txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtharpen.Text = Val(harga) * Val(Txtjumlah)
Select Case Txtharpen.Text
Case Is > 30000000
Txtdiskon.Text = Val(Txtharpen) * 0.15
Case Is > 25000000
Txtdiskon.Text = Val(Txtharpen) * 0.1
Case Is > 20000000
Txtdiskon.Text = Val(Txtharpen) * 0.05
Case Is > 15000000
Txtdiskon.Text = Val(Txtharpen) * 0.02
End Select
Txtbayar.Text = Val(harpen) – 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