tugas2

program2

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

Txtjenis.Text = jenis

Txths.Text = harga

Txtjj.SetFocus

End Sub

Private Sub Command1_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 Command2_Click()

Cbokode.SetFocus

Cbokode.Text = “”

Txtjenis.Text = “”

Txths.Text = “”

Txtjj.Text = “”

Txthp.Text = “”

Txtdiskon.Text = “”

Txthb.Text = “”

End Sub

Private Sub Command3_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