Tugas 3


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 cmdhitung_Click()
Combo1.SetFocus
Combo1.Text = “”
txtjk.Text = “”
txths.Text = “”
txtjj.Text = “”
txthp.Text = “”
txtdiscount.Text = “”
txthb.Text = “”
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub Combo1_Click()
Dim jk As String
Dim hs As Currency
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 Giga Hz”
hs = “3500000”
Case “P415”
jk = “Pentium III 1.5 Giga Hz”
hs = “4000000”
Case “P417”
jk = “Pentium IV 1.7 Giga Hz”
hs = “4200000”
Case “P419”
jk = “Pentium IV 1.9 Giga Hz”
hs = “5500000”
End Select
txtjk.Text = jk
txths.Text = hs
txtjj.SetFocus
End Sub

Private Sub cmdproses_Click()
txthp.Text = Val(txtjj.Text) * Val(txths.Text)
If txthp.Text > 30000000 Then
txtdiscount.Text = Val(txthp.Text) * 0.15
ElseIf txthp.Text > 25000000 Then
txtdiscount.Text = Val(txthp.Text) * 0.1
ElseIf txthp.Text > 20000000 Then
txtdiscount.Text = Val(txthp.Text) * 0.05
ElseIf txthp.Text > 15000000 Then
txtdiscount.Text = Val(txthp.Text) * 0.02
End If
txthb.Text = Val(txthp.Text) – Val(txtdiscount.Text)
End Sub

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 )

Gambar Twitter

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

Foto Facebook

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

Foto Google+

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

Connecting to %s