Membuat Program Form Nilai Mahasiswa menggunakan VB.Net 2008
Friday, November 15, 2013
0
comments
'Designlah seperti pada gambar'
'Berikut listing program yang akan anda inputkan'
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
npm.Items.Add("12110935")
npm.Items.Add("12010022")
npm.Items.Add("12020023")
kode_dosen.Items.Add("D123")
kode_dosen.Items.Add("D345")
kode_dosen.Items.Add("D678")
kode_matakuliah.Items.Add("K001")
kode_matakuliah.Items.Add("K002")
kode_matakuliah.Items.Add("K003")
Dim i As Integer
Nilai_kehadiran.Items.Clear()
For i = 1 To 100
Nilai_kehadiran.Items.Add(i)
Next
Nilai_tugas.Items.Clear()
For i = 1 To 100
Nilai_tugas.Items.Add(i)
Next
Nilai_UTS.Items.Clear()
For i = 1 To 100
Nilai_UTS.Items.Add(i)
Next
Nilai_UAS.Items.Clear()
For i = 1 To 100
Nilai_UAS.Items.Add(i)
Next
End Sub
Private Sub npm_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles npm.SelectedIndexChanged
Select Case npm.Text
Case "12110935"
nama.Text = "Erixon Andrianus Saruksuk"
Case "12020023"
nama.Text = "Abdul Rahmad"
Case "12010022"
nama.Text = "Rinaldi Pratama"
End Select
Dim x As String
x = Strings.Mid(npm.Text, 3, 2)
If x = "11" Then
jurusan.Text = "Teknik Informatika"
ElseIf x = "02" Then
jurusan.Text = "Manajemen Informatika"
ElseIf x = "01" Then
jurusan.Text = "Teknik Komputer"
End If
x = Strings.Mid(npm.Text, 3, 2)
If x = "11" Then
Jenjang.Text = "S I"
ElseIf x = "02" Then
Jenjang.Text = "D III"
ElseIf x = "01" Then
Jenjang.Text = "D I"
End If
End Sub
Private Sub KD_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles kode_dosen.SelectedIndexChanged
Select Case kode_dosen.Text
Case "D123"
Nama_dosen.Text = "Mesran,S.kom, M.Kom"
Case "D345"
Nama_dosen.Text = "Rivalry K Hondro, S.Kom"
Case "D678"
Nama_dosen.Text = "Kenedi Tampubolon,S.si, M.Kom"
End Select
End Sub
Private Sub KM_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles kode_matakuliah.SelectedIndexChanged
Select Case kode_matakuliah.Text
Case "K001"
nama_mata_kuliah.Text = "Pemrograman Visual 1"
Case "K002"
nama_mata_kuliah.Text = "Sistem Basis Data"
Case "K003"
nama_mata_kuliah.Text = "Matriks dan Transformasi Linear"
End Select
End Sub
Private Sub Btn_Proses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Proses.Click
Nilai_Akhir.Text = 0.1 * Nilai_kehadiran.Text + 0.15 * Nilai_tugas.Text + 0.3 * Nilai_UTS.Text + 0.45 * Nilai_UAS.Text
If Nilai_Akhir.Text >= 80 Then
Nilai_Huruf.Text = "A"
ElseIf Nilai_Akhir.Text >= 70 Then
Nilai_Huruf.Text = "B"
ElseIf Nilai_Akhir.Text >= 60 Then
Nilai_Huruf.Text = "C"
ElseIf Nilai_Akhir.Text >= 50 Then
Nilai_Huruf.Text = "D"
Else
Nilai_Huruf.Text = "E"
End If
If Nilai_Akhir.Text >= 50 Then
Keterangan.Text = "Lulus"
Else
Keterangan.Text = "Gagal"
End If
End Sub
Private Sub Btn_Keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Keluar.Click
Close()
End Sub
Private Sub Btn_hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_hapus.Click
nama.Text = ""
npm.Text = ""
Keterangan.Text = ""
Nilai_UTS.Text = ""
Nilai_UAS.Text = ""
Nilai_tugas.Text = ""
Nilai_kehadiran.Text = ""
Nilai_Akhir.Text = ""
kode_dosen.Text = ""
kode_matakuliah.Text = ""
Nilai_Huruf.Text = ""
Nama_dosen.Text = ""
nama_mata_kuliah.Text = ""
Jenjang.Text = ""
jurusan.Text = ""
End Sub
End Class
'Jalankan Program dengan menekan tombol F5 pada keyboard'
'contoh hasil tampilan program ketika dijalankan'
'Berikut listing program yang akan anda inputkan'
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
npm.Items.Add("12110935")
npm.Items.Add("12010022")
npm.Items.Add("12020023")
kode_dosen.Items.Add("D123")
kode_dosen.Items.Add("D345")
kode_dosen.Items.Add("D678")
kode_matakuliah.Items.Add("K001")
kode_matakuliah.Items.Add("K002")
kode_matakuliah.Items.Add("K003")
Dim i As Integer
Nilai_kehadiran.Items.Clear()
For i = 1 To 100
Nilai_kehadiran.Items.Add(i)
Next
Nilai_tugas.Items.Clear()
For i = 1 To 100
Nilai_tugas.Items.Add(i)
Next
Nilai_UTS.Items.Clear()
For i = 1 To 100
Nilai_UTS.Items.Add(i)
Next
Nilai_UAS.Items.Clear()
For i = 1 To 100
Nilai_UAS.Items.Add(i)
Next
End Sub
Private Sub npm_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles npm.SelectedIndexChanged
Select Case npm.Text
Case "12110935"
nama.Text = "Erixon Andrianus Saruksuk"
Case "12020023"
nama.Text = "Abdul Rahmad"
Case "12010022"
nama.Text = "Rinaldi Pratama"
End Select
Dim x As String
x = Strings.Mid(npm.Text, 3, 2)
If x = "11" Then
jurusan.Text = "Teknik Informatika"
ElseIf x = "02" Then
jurusan.Text = "Manajemen Informatika"
ElseIf x = "01" Then
jurusan.Text = "Teknik Komputer"
End If
x = Strings.Mid(npm.Text, 3, 2)
If x = "11" Then
Jenjang.Text = "S I"
ElseIf x = "02" Then
Jenjang.Text = "D III"
ElseIf x = "01" Then
Jenjang.Text = "D I"
End If
End Sub
Private Sub KD_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles kode_dosen.SelectedIndexChanged
Select Case kode_dosen.Text
Case "D123"
Nama_dosen.Text = "Mesran,S.kom, M.Kom"
Case "D345"
Nama_dosen.Text = "Rivalry K Hondro, S.Kom"
Case "D678"
Nama_dosen.Text = "Kenedi Tampubolon,S.si, M.Kom"
End Select
End Sub
Private Sub KM_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles kode_matakuliah.SelectedIndexChanged
Select Case kode_matakuliah.Text
Case "K001"
nama_mata_kuliah.Text = "Pemrograman Visual 1"
Case "K002"
nama_mata_kuliah.Text = "Sistem Basis Data"
Case "K003"
nama_mata_kuliah.Text = "Matriks dan Transformasi Linear"
End Select
End Sub
Private Sub Btn_Proses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Proses.Click
Nilai_Akhir.Text = 0.1 * Nilai_kehadiran.Text + 0.15 * Nilai_tugas.Text + 0.3 * Nilai_UTS.Text + 0.45 * Nilai_UAS.Text
If Nilai_Akhir.Text >= 80 Then
Nilai_Huruf.Text = "A"
ElseIf Nilai_Akhir.Text >= 70 Then
Nilai_Huruf.Text = "B"
ElseIf Nilai_Akhir.Text >= 60 Then
Nilai_Huruf.Text = "C"
ElseIf Nilai_Akhir.Text >= 50 Then
Nilai_Huruf.Text = "D"
Else
Nilai_Huruf.Text = "E"
End If
If Nilai_Akhir.Text >= 50 Then
Keterangan.Text = "Lulus"
Else
Keterangan.Text = "Gagal"
End If
End Sub
Private Sub Btn_Keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Keluar.Click
Close()
End Sub
Private Sub Btn_hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_hapus.Click
nama.Text = ""
npm.Text = ""
Keterangan.Text = ""
Nilai_UTS.Text = ""
Nilai_UAS.Text = ""
Nilai_tugas.Text = ""
Nilai_kehadiran.Text = ""
Nilai_Akhir.Text = ""
kode_dosen.Text = ""
kode_matakuliah.Text = ""
Nilai_Huruf.Text = ""
Nama_dosen.Text = ""
nama_mata_kuliah.Text = ""
Jenjang.Text = ""
jurusan.Text = ""
End Sub
End Class
'Jalankan Program dengan menekan tombol F5 pada keyboard'
'contoh hasil tampilan program ketika dijalankan'