KUIS ONLINE BELAJAR BAHASA PEMROGRAMAN
Kali ini saya mau memposting artikel Quis online kuliah saya.
Bentuk Form Awal
Dibawah ini kode designnya :
Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Nama.Items.Add("SONY
V46")
Nama.Items.Add("SONY
Q10")
Nama.Items.Add("SONY
M25")
Nama.Items.Add("SONY
3D")
Nama.Items.Add("SONY
TURBO SOUND")
Dim i As Integer
For i =
1 To 10
Jumlah.Items.Add(i)
Next
End Sub
Private Sub Nama_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
Nama.SelectedIndexChanged
Select Case Nama.Text
Case
"SONY V46"
Harga.Text = "2000000"
Case
"SONY Q10"
Harga.Text = "4500000"
Case
"SONY M25"
Harga.Text = "4000000"
Case
"SONY 3D"
Harga.Text = "6500000"
Case
"SONY TURBO SOUND"
Harga.Text = "6000000"
End Select
End Sub
Private Sub Totalharga_KeyPress(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
Totalharga.KeyPress
Totalharga.Text = Harga.Text *
Jumlah.Text
If
Totalharga.Text > 2500000 Then
Discount.Text = 0.1 *
Totalharga.Text
Else
Discount.Text = 0
End If
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Total.Text = Totalharga.Text -
Discount.Text
End Sub
End Class
No comments:
Post a Comment
Silahkan tinggalkan komentar dibawah ini. Jadilah pembaca yang aktif. Gomawo ^^