Asslamaualaikum,,,
wah sepertinya hari ini adalah hari yang melelah kan walaupun harus ini hari libur,,,
hari ini adalah hari dimana saya dan teman-teman sekelasnya manghadapi ujian online,,,
Latihan Program Nilai Dari VB. NET
ok langsung aja ya,,,
ini dia,,,,
Taraaaa,,,
langkah pertama sekali buka VB Net 2008 dan desain form berikut ini,,,
dan perhatikan dengan benar listing program berikut ini,,
Nah Itulah Contoh Program VB.NET 2008 saya,,,,
semoga bermanfaat dan Salam Sukses Bagi Kita semua,,, :D
wah sepertinya hari ini adalah hari yang melelah kan walaupun harus ini hari libur,,,
hari ini adalah hari dimana saya dan teman-teman sekelasnya manghadapi ujian online,,,
Latihan Program Nilai Dari VB. NET
ok langsung aja ya,,,
ini dia,,,,
Taraaaa,,,
langkah pertama sekali buka VB Net 2008 dan desain form berikut ini,,,
dan perhatikan dengan benar listing program berikut ini,,
- Public Class Form1
- Dim w As Byte
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- hidupmati(False, False, False, False, False, False, False, False, False, False, False, False, False,False, False, False)
- w = 1
- rubahbutton(True, False, False, False, False, True)
- buattabel()
- NPM.Items.Add("12110057")
- NPM.Items.Add("12120147")
- NPM.Items.Add("12130289")
- NPM.Items.Add("12120344")
- NPM.Items.Add("12110490")
- kddosen.Items.Add("lab01")
- kddosen.Items.Add("lab02")
- kddosen.Items.Add("lab03")
- kdmakul.Items.Add("K01")
- kdmakul.Items.Add("K02")
- kdmakul.Items.Add("K03")
- Dim x As Integer
- For x = 100 To 1 Step -3
- nkehadiran.Items.Add(x)
- ntugas.Items.Add(x)
- nUTS.Items.Add(x)
- nUAS.Items.Add(x)
- Next
- nakhir.Enabled = False
- nhuruf.Enabled = False
- keterangan.Enabled = False
- End Sub
- Sub jurjen()
- Dim jen = Microsoft.VisualBasic.Mid(NPM.Text, 3, 2)
- Dim jur = Microsoft.VisualBasic.Mid(NPM.Text, 5, 2)
- If jen = "11" Then
- jenjang.Text = "S1"
- ElseIf jen = "12" Then
- jenjang.Text = "D3"
- ElseIf jen = "13" Then
- jenjang.Text = "D1"
- End If
- If jur = "00" Then
- jurusan.Text = "Tehnik Informatika"
- ElseIf jur = "01" Then
- jurusan.Text = "Sistem Informatika"
- ElseIf jur = "02" Then
- jurusan.Text = "Manajemen Informatika"
- ElseIf jur = "03" Then
- jurusan.Text = "Komputerisasi Akuntansi"
- ElseIf jur = "04" Then
- jurusan.Text = "Desain Grafis"
- End If
- End Sub
- Private Sub NPM_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesNPM.SelectedIndexChanged
- If NPM.Text = "12110057" Then
- nama.Text = "Andre Ibo"
- Call jurjen()
- ElseIf NPM.Text = "12120147" Then
- nama.Text = "Partrick Wanggai"
- Call jurjen()
- ElseIf NPM.Text = "12130289" Then
- nama.Text = "Evan Dimas"
- Call jurjen()
- ElseIf NPM.Text = "12120344" Then
- nama.Text = "Putu Gede"
- Call jurjen()
- ElseIf NPM.Text = "12110490" Then
- nama.Text = "Firman Utina"
- Call jurjen()
- End If
- End Sub
- Private Sub kddosen_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handleskddosen.SelectedIndexChanged
- If kddosen.Text = "lab01" Then
- namadosen.Text = "Mesran, M.Kom"
- ElseIf kddosen.Text = "lab02" Then
- namadosen.Text = "Nelly Astuti Hsb, M.Kom"
- ElseIf kddosen.Text = "lab03" Then
- namadosen.Text = "Surya Darma Nst, M.Kom"
- End If
- End Sub
- Private Sub kdmakul_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handleskdmakul.SelectedIndexChanged
- If kdmakul.Text = "K01" Then
- namamakul.Text = "Pemrograman Visual I"
- ElseIf kdmakul.Text = "K02" Then
- namamakul.Text = "Sistem Basis Data"
- ElseIf kdmakul.Text = "K03" Then
- namamakul.Text = "Arsitektur Data"
- End If
- End Sub
- Private Sub b_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bproses.Click
- nakhir.Text = 0.1 * nkehadiran.Text + 0.15 * ntugas.Text + 0.3 * nUTS.Text + 0.45 * nUAS.Text
- If nakhir.Text >= 90 Then
- nhuruf.Text = "A"
- keterangan.Text = "LULUS"
- ElseIf nakhir.Text >= 80 Then
- nhuruf.Text = "B"
- keterangan.Text = "LULUS"
- ElseIf nakhir.Text >= 70 Then
- nhuruf.Text = "C"
- keterangan.Text = "LULUS"
- ElseIf nakhir.Text >= 60 Then
- nhuruf.Text = "D"
- keterangan.Text = "LULUS"
- ElseIf nakhir.Text <= 50 Then
- nhuruf.Text = "E"
- keterangan.Text = "GAGAL"
- End If
- End Sub
- Sub bersih()
- NPM.Text = ""
- nama.Text = ""
- jenjang.Text = ""
- jurusan.Text = ""
- kddosen.Text = ""
- namadosen.Text = ""
- kdmakul.Text = ""
- namamakul.Text = ""
- nkehadiran.Text = ""
- ntugas.Text = ""
- nUTS.Text = ""
- nUAS.Text = ""
- nakhir.Text = ""
- nhuruf.Text = ""
- keterangan.Text = ""
- NPM.Focus()
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bhapus.Click
- bersih()
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bkeluar.Click
- Me.Close()
- End Sub
- Sub buattabel()
- Lv.Columns.Add("No", 20, HorizontalAlignment.Center)
- Lv.Columns.Add("Nama", 80, HorizontalAlignment.Left)
- Lv.Columns.Add("Jumlah", 50, HorizontalAlignment.Left)
- Lv.Columns.Add("Jenjang", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Jurusan", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Kode Dosen", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Nama Dosen", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Kode Mata Kuliah", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Nama Mata Kuliah", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Nilai Kehadiran", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Nilai Tugas", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Nilai UTS", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Nilai UAS", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Nilai Akhir", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Nilai Huruf", 70, HorizontalAlignment.Left)
- Lv.Columns.Add("Keterangan", 70, HorizontalAlignment.Left)
- Lv.View = View.Details
- Lv.GridLines = True
- Lv.FullRowSelect = True
- End Sub
- Sub isitabel()
- Dim Isi As New ListViewItem
- Isi.Text = w
- Isi.SubItems.Add(NPM.Text)
- Isi.SubItems.Add(nama.Text)
- Isi.SubItems.Add(jenjang.Text)
- Isi.SubItems.Add(jurusan.Text)
- Isi.SubItems.Add(kddosen.Text)
- Isi.SubItems.Add(namadosen.Text)
- Isi.SubItems.Add(kdmakul.Text)
- Isi.SubItems.Add(namamakul.Text)
- Isi.SubItems.Add(nkehadiran.Text)
- Isi.SubItems.Add(ntugas.Text)
- Isi.SubItems.Add(nUTS.Text)
- Isi.SubItems.Add(nUAS.Text)
- Isi.SubItems.Add(nakhir.Text)
- Isi.SubItems.Add(nhuruf.Text)
- Isi.SubItems.Add(keterangan.Text)
- Lv.Items.Add(Isi)
- w = w + 1
- End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bsimpan.Click
- isitabel()
- End Sub
- Sub hidupmati(ByVal q1 As Boolean, ByVal q2 As Boolean, ByVal q3 As Boolean, ByVal q4 As Boolean, ByVal q5 AsBoolean, ByVal q6 As Boolean, ByVal q7 As Boolean, ByVal q8 As Boolean, ByVal q9 As Boolean, ByVal q10 As Boolean,ByVal q11 As Boolean, ByVal q12 As Boolean, ByVal q13 As Boolean, ByVal q14 As Boolean, ByVal q15 As Boolean,ByVal q16 As Boolean)
- NPM.Enabled = q1
- nama.Enabled = q2
- jenjang.Enabled = q3
- jurusan.Enabled = q4
- kddosen.Enabled = q5
- namadosen.Enabled = q6
- kdmakul.Enabled = q7
- namamakul.Enabled = q8
- nkehadiran.Enabled = q9
- ntugas.Enabled = q10
- nUTS.Enabled = q11
- nUAS.Enabled = q12
- nakhir.Enabled = q13
- nhuruf.Enabled = q14
- keterangan.Enabled = q15
- Lv.Enabled = q16
- End Sub
- Private Sub bbaru_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bbaru.Click
- hidupmati(True, True, True, True, True, True, True, True, True, True, True, True, False, False, False,True)
- rubahbutton(True, True, True, True, True, True)
- NPM.Focus()
- bersih()
- End Sub
- Private Sub HapusItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handlesbhapusitem.Click
- Lv.Items.Remove(Lv.SelectedItems(0))
- End Sub
- Sub rubahbutton(ByVal e1 As Boolean, ByVal e2 As Boolean, ByVal e3 As Boolean, ByVal e4 As Boolean, ByVal e5As Boolean, ByVal e6 As Boolean)
- bbaru.Enabled = e1
- bsimpan.Enabled = e2
- bproses.Enabled = e3
- bhapus.Enabled = e4
- bhapusitem.Enabled = e5
- bkeluar.Enabled = e6
- End Sub
- End Class
Nah Itulah Contoh Program VB.NET 2008 saya,,,,
semoga bermanfaat dan Salam Sukses Bagi Kita semua,,, :D