Belajar Bahasa Pemograman
Postingan ini saya buat untuk melengkapi tugas mata kuliah Pemograman Visual saya.. Disini saya akan membuat form Penilaian Mahasiswa dengan Visual BasicPertama dibuat dulu form seperti dibawah ini :
Gambar 1.1 Bentuk Form
Lalu isikan perintah dibawah ini untuk vb.design nya.
Private Sub NPM_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
NPM.SelectedIndexChanged
Select Case NPM.Text
Case
"12110404"
Nama.Text = "Kristina Nancy Lumban Gaol"
Jenjang.Text = "S1"
Jurusan.Text = "Tekhnologi Informatika"
Case
"12110402"
Nama.Text = "Cahyo Sobirin"
Jenjang.Text = "S1"
Jurusan.Text = "Sistem Informasi"
Case
"12110377"
Nama.Text = "Meitri widya Pradipta"
Jenjang.Text = "S1"
Jurusan.Text = "Tekhnologi Informatika"
Case
"12110378"
Nama.Text = "Doni Armando"
Jenjang.Text = "S1"
Jurusan.Text = "Manajemen Informatika"
Case
"12110400"
Nama.Text = "Steven Ginting"
Jenjang.Text = "S1"
Jurusan.Text = "Manajemen
Informatika"
End Select
End Sub
Private Sub kddosen_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
kddosen.SelectedIndexChanged
Select Case kddosen.Text
Case "318"
namdos.Text = "Yasir Hasan, S.Kom"
Case
"401"
namdos.Text = "Sinar Sinurat,ST,M.Kom"
Case
"206"
namdos.Text = "Mesran,S.Kom,M.Kom"
Case
"408"
namdos.Text = "Kennedi Tampubolon,S.Si"
Case
"204"
namdos.Text = "Kristian Siregar,S.Kom"
End Select
End Sub
Dan inilah hasilnya :
Private Sub kdmakul_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
kdmakul.SelectedIndexChanged
Select Case kdmakul.Text
Case
"KB001"
Makul.Text = "Pemograman HTML"
Case
"KB002"
Makul.Text = "Matematika Diskrit"
Case
"KB003"
Makul.Text = "Pemrogaman Visual Basic"
Case
"KB0004"
Makul.Text = "Matriks dan Linear"
Case
"KB005"
Makul.Text = "Struktur Data"
End Select
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
NPM.Items.Add("12110404")
NPM.Items.Add("12110402")
NPM.Items.Add("12110377")
NPM.Items.Add("12110378")
NPM.Items.Add("12110400")
kddosen.Items.Add("318")
kddosen.Items.Add("401")
kddosen.Items.Add("206")
kddosen.Items.Add("408")
kddosen.Items.Add("204")
kdmakul.Items.Add("KB001")
kdmakul.Items.Add("KB002")
kdmakul.Items.Add("KB003")
kdmakul.Items.Add("KB004")
kdmakul.Items.Add("KB005")
Dim K As Integer
For K =
100 To 1 Step
-3
Hadir.Items.Add(K)
Next
(K)
K = 100
Do While K >= 1
Tugas.Items.Add(K)
K = K - 3
Loop
For K =
100 To 1 Step
-4
UTS.Items.Add(K)
Next
(K)
For K =
100 To 1 Step
-3
UAS.Items.Add(K)
Next
(K)
End Sub
Private Sub btnproses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnproses.Click
Akhir.Text = 0.45 * UAS.Text + 0.3 *
UTS.Text + 0.15 * Tugas.Text + 0.1 * Hadir.Text()
If
Akhir.Text >= 50 Then
Ket.Text = "Lulus"
Else
Ket.Text = "Gagal"
End If
If
Akhir.Text >= 80 Then
Huruf.Text = "A"
ElseIf
Akhir.Text >= 70 Then
Huruf.Text = "B"
ElseIf
Akhir.Text >= 60 Then
Huruf.Text = "C"
ElseIf
Akhir.Text >= 50 Then
Huruf.Text = "D"
Else
Huruf.Text = "E"
End If
End Sub
Private Sub btnhapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnhapus.Click
NPM.Text = ("")
Nama.Text = ("")
Jenjang.Text = ("")
Jurusan.Text = ("")
kddosen.Text = ("")
namdos.Text = ("")
kdmakul.Text = ("")
Makul.Text = ("")
Hadir.Text = ("")
Tugas.Text = ("")
UTS.Text = ("")
UAS.Text = ("")
Akhir.Text = ("")
Huruf.Text = ("")
Ket.Text = ("")
End Sub
End Class
Dan inilah hasilnya :
Gambar 1.2 Hasil Form Penilaian
No comments:
Post a Comment
Silahkan tinggalkan komentar dibawah ini. Jadilah pembaca yang aktif. Gomawo ^^