PENJELASAN
Pada tugas Visual Basic yang ke-2 ini,saya membuat sebuah program sederhana mengenai cara memilih tempat bermain futsal di wilayah Universitas Indonesia beserta harga lapangannya per jam. Terdiri dari 4 tempat futsal yang sering dikunjungi oleh mahasiswa, buka mulai dari hari Senin-Minggu ( setiap hari ) pukul 08.00 - 20.00 WIB. Jika bermain futsal dari pukul 08.00 - 13.00 WIB, maka semua tempat futsal akan memberikan diskon 10 % kepada setiap pengunjungnya.
DESIGN FORM 1 SEBELUM DEBUG
CODING FORM 1
Jika kita memilih salah satu tempat futsalnya dan mengklik Hitung,maka akan muncul harga lapangan per jamnya,lalu harga+diskon 10 % dan total harga setelah dikurangi diskon tersebut. Jika mengklik Hapus,maka semua data akan terhapus,dan bila mengklik Keluar,maka program akan berakhir/keluar dengan MsgBox. Semua lapangan buka setiap hari,dari pukul 08.00 - 20.00 WIB,namun dari pukul 08.00-13.00 WIB,semua lapangan futsal akan memberikan diskon 10 % kepada pengunjung.
DESIGN FORM 1 SETELAH DEBUG ( KLIK HITUNG )
DESIGN FORM 1 SETELAH DEBUG ( KLIK HAPUS )
DESIGN FORM 1 SETELAH DEBUG ( KLIK KELUAR )
SOURCE CODE FORM 1
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If RadioButton1.Checked = True Then
TextBox1.Text = 150000
TextBox2.Text = 150000 * 0.1
TextBox3.Text = 150000 - (150000 * 0.1)
End If
If RadioButton2.Checked = True Then
TextBox1.Text = 100000
TextBox2.Text = 100000 * 0.1
TextBox3.Text = 100000 - (100000 * 0.1)
End If
If RadioButton3.Checked = True Then
TextBox1.Text = 125000
TextBox2.Text = 125000 * 0.1
TextBox3.Text = 125000 - (125000 * 0.1)
End If
If RadioButton4.Checked = True Then
TextBox1.Text = 80000
TextBox2.Text = 80000 * 0.1
TextBox3.Text = 80000 - (80000 * 0.1)
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim x As String
x = MsgBox(" Anda Yakin Keluar ? ", MsgBoxStyle.YesNo, "Konfirmasi")
If x = vbYes Then
End
End If
End Sub
End Class
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If RadioButton1.Checked = True Then
TextBox1.Text = 150000
TextBox2.Text = 150000 * 0.1
TextBox3.Text = 150000 - (150000 * 0.1)
End If
If RadioButton2.Checked = True Then
TextBox1.Text = 100000
TextBox2.Text = 100000 * 0.1
TextBox3.Text = 100000 - (100000 * 0.1)
End If
If RadioButton3.Checked = True Then
TextBox1.Text = 125000
TextBox2.Text = 125000 * 0.1
TextBox3.Text = 125000 - (125000 * 0.1)
End If
If RadioButton4.Checked = True Then
TextBox1.Text = 80000
TextBox2.Text = 80000 * 0.1
TextBox3.Text = 80000 - (80000 * 0.1)
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim x As String
x = MsgBox(" Anda Yakin Keluar ? ", MsgBoxStyle.YesNo, "Konfirmasi")
If x = vbYes Then
End
End If
End Sub
End Class
Data Mahasiswa
Nama : Amri Shadiqin
NPM : 1006724280
UNIVERSITAS INDONESIA