Mata Kuliah Semester 3
Pemrograman Visual I
§ CODING MEMBUAT SEBUAH §
§ PROGRAM/APLIKASI §
§ PENYIMPANAN DATA ASURANSI §
بسم الله الرحمن الرحيم
Aplikasi ini menggunakan Visual Basic aja.
Dan berikut ini adalah rumus codingannya :
Selamat mencoba =)
Public Class Form1
Dim st As String
Dim inz(0, 6) As String
Dim ii As Integer = 0
Dim jml As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
cek()
simpandata()
hitung()
tampilan()
bersih()
End Sub
Private Sub bersih()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox4.Text = ""
ComboBox1.Text = ""
RadioButton1.Checked = False
RadioButton2.Checked = False
End Sub
Private Function cek()
If RadioButton1.Checked = True Then
st = "Baru"
ElseIf RadioButton2.Checked = True Then
st = "Perpanjangan"
End If
Return st
End Function
Private Sub tampilan()
ListView1.Items.Add(TextBox1.Text)
ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(TextBox2.Text)
ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(ComboBox1.Text)
ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(TextBox4.Text)
ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(st)
ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(jml)
End Sub
Private Sub simpandata()
inz(ii, 0) = TextBox1.Text
inz(ii, 1) = TextBox2.Text
inz(ii, 2) = ComboBox1.Text
inz(ii, 3) = TextBox4.Text
inz(ii, 4) = st
inz(ii, 5) = jml
ii = ii + 1
ReDim inz(1, 6)
End Sub
Private Sub isicombo()
ComboBox1.Items.Add("Mobil")
ComboBox1.Items.Add("Sepeda Motor")
End Sub
Public Function hitung() As Integer
If st = "Baru" Then
jml = (CInt(TextBox4.Text) / 60) + ((CInt(TextBox4.Text) / 60) * 0.15)
ElseIf st = "Perpanjangan" Then
jml = (CInt(TextBox4.Text) / 60) + ((CInt(TextBox4.Text) / 60) * 0.1)
End If
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
isicombo()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Application.Exit()
End Sub
End Class
Makasih udah mau mengunjungi blogku ..
Semoga berhasil dan ilmunya bisa bermanfaat lebih dan lebih lagi ..
^^
0 komentar
Posting Komentar