Listing Program:
Public Class Form1
Dim val_a, val_b, val_c, val_d, val_e, val_f As Double
Dim total As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckBox1.CheckState = CheckState.Checked Then
val_a = (Val(TextBox1.Text) * 10000)
ListBox1.Items.Add(Val(TextBox1.Text) & " " & "Pecel Ayam")
Else
val_a = 0
End If
If CheckBox2.CheckState = CheckState.Checked Then
val_b = (Val(TextBox2.Text) * 12000)
ListBox1.Items.Add(Val(TextBox2.Text) & " " & "Ayam Bakar")
Else
val_b = 0
End If
If CheckBox3.CheckState = CheckState.Checked Then
val_c = (Val(TextBox3.Text) * 15000)
ListBox1.Items.Add(Val(TextBox3.Text) & " " & "Ayam Rica-Rica")
Else
val_c = 0
End If
If CheckBox4.CheckState = CheckState.Checked Then
val_d = (Val(TextBox4.Text) * 2000)
ListBox1.Items.Add(Val(TextBox4.Text) & " " & "Air Mineral")
Else
val_d = 0
End If
If CheckBox5.CheckState = CheckState.Checked Then
val_e = (Val(TextBox5.Text) * 3000)
ListBox1.Items.Add(Val(TextBox5.Text) & " " & "Es Teh Manis")
Else
val_e = 0
End If
If CheckBox6.CheckState = CheckState.Checked Then
val_f = (Val(TextBox6.Text) * 5000)
ListBox1.Items.Add(Val(TextBox6.Text) & " " & "Es Jeruk")
Else
val_d = 0
End If
total = val_a + val_b + val_c + val_d + val_e + val_f
ListBox2.Items.Add(total)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Output:
0 comments :
Post a Comment