Anda di halaman 1dari 2

Public Class BisFungsi

If RadioButton2.Checked = True Then


Private Sub RadioButton1_CheckedChanged(ByVal sender As If RadioButton3.Checked = True Then
System.Object, ByVal e As System.EventArgs) Handles Select Case ComboBox1.SelectedIndex
RadioButton1.CheckedChanged Case 0 : harga = 10000
ComboBox1.Items.Clear() Case 1 : harga = 30000
ComboBox1.Items.Add("Ploso") Case 2 : harga = 50000
ComboBox1.Items.Add("Babat") End Select
ComboBox1.Items.Add("Tuban") Else
End Sub Select Case ComboBox1.SelectedIndex
Case 0 : harga = 20000
Private Sub RadioButton2_CheckedChanged(ByVal sender As Case 1 : harga = 50000
System.Object, ByVal e As System.EventArgs) Handles Case 2 : harga = 70000
RadioButton2.CheckedChanged End Select
ComboBox1.Items.Clear() End If
ComboBox1.Items.Add("Kandangan") If RadioButton5.Checked = True Then
ComboBox1.Items.Add("Pujon") total = harga * Val(TextBox1.Text)
ComboBox1.Items.Add("Malang") TextBox2.Text = Str(SepuluhPersen(Val(total)))
End Sub ElseIf RadioButton6.Checked = True Then
Private Sub Cmdhitung_Click(ByVal sender As System.Object, ByVal total = harga * Val(TextBox1.Text)
e As System.EventArgs) Handles Cmdhitung.Click TextBox2.Text = Str(DuaPuluhPersen(Val(total)))
Dim harga, total As Double Else
If RadioButton1.Checked = True Then total = harga * Val(TextBox1.Text)
If RadioButton3.Checked = True Then TextBox2.Text = Str(LimaPuluhPersen(Val(total)))
Select Case ComboBox1.SelectedIndex End If
Case 0 : harga = 5000 End If
Case 1 : harga = 10000
Case 2 : harga = 30000 End Sub
End Select Private Sub Cmdkeluar_Click(ByVal sender As System.Object, ByVal
Else e As System.EventArgs) Handles Cmdkeluar.Click
Select Case ComboBox1.SelectedIndex End
Case 0 : harga = 10000 End Sub
Case 1 : harga = 20000
Case 2 : harga = 40000 End Class
End Select
End If Module Module_fungsi
If RadioButton5.Checked = True Then Function SepuluhPersen(ByVal Persen As Single) As Single
total = harga * Val(TextBox1.Text) SepuluhPersen = (Persen - Persen / 10)
TextBox2.Text = Str(SepuluhPersen(Val(total))) End Function
ElseIf RadioButton6.Checked = True Then Function DuaPuluhPersen(ByVal Persen As Single) As Single
total = harga * Val(TextBox1.Text) DuaPuluhPersen = (Persen - Persen / 5)
TextBox2.Text = Str(DuaPuluhPersen(Val(total))) End Function
Else Function LimaPuluhPersen(ByVal Persen As Single) As Single
total = harga * Val(TextBox1.Text) LimaPuluhPersen = (Persen - Persen / 2)
TextBox2.Text = Str(LimaPuluhPersen(Val(total))) End Function
End If End Module
End If
g

Anda mungkin juga menyukai