Minggu, 08 Desember 2013
contoh program Cb.net sederhana
di bawah ini adalah cara gimana untuk membuat program seperti di atas!!
selamat mencoba..
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
NPM.Items.Add("12110298")
NPM.Items.Add("13111057")
NPM.Items.Add("12111009")
NPM.Items.Add("10111077")
KodeDosen.Items.Add("982")
KodeDosen.Items.Add("973")
KodeDosen.Items.Add("957")
KodeDosen.Items.Add("999")
KodeMatakuliah.Items.Add("A23")
KodeMatakuliah.Items.Add("A24")
KodeMatakuliah.Items.Add("A25")
KodeMatakuliah.Items.Add("A26")
KodeMatakuliah.Items.Add("A27")
KodeMatakuliah.Items.Add("A28")
KodeMatakuliah.Items.Add("A29")
Dim i As Byte
For i = 1 To 100
NilaiKehadiran.Items.Add(i)
NilaiTugas.Items.Add(i)
NilaiUTS.Items.Add(i)
NilaiUAS.Items.Add(i)
Next
End Sub
Private Sub NPM_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NPM.SelectedIndexChanged
Dim x, y As String
x = Microsoft.VisualBasic.Left(NPM.Text, 3)
y = Microsoft.VisualBasic.Right(NPM.Text, 3)
Select Case NPM.Text
Case "12110298"
Nama.Text = "benny syahputra"
Case "13111057"
Nama.Text = "eko juliansyah"
Case "12111009"
Nama.Text = "Rio"
Case "10111077"
Nama.Text = "Jayen"
End Select
Select Case x
Case "131"
Jenjang.Text = "DII"
Case "121"
Jenjang.Text = "S1"
Case "121"
Jenjang.Text = "S1"
Case "101"
Jenjang.Text = "DIII"
Case Else
Jenjang.Text = "_"
End Select
Select Case y
Case "298"
Jurusan.Text = "Teknik Informatika"
Case "057"
Jurusan.Text = "Managemen informatika"
Case "009"
Jurusan.Text = "Sistem Informasi"
Case "077"
Jurusan.Text = "Manajemen informatika"
Case Else
Jurusan.Text = "_"
End Select
End Sub
Private Sub KodeDosen_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KodeDosen.SelectedIndexChanged
Select Case KodeDosen.Text
Case "982"
NamaDosen.Text = "M.Syahrizal, M.kom"
Case "973"
NamaDosen.Text = "Mesran S.Kom,M.Kom"
Case "957"
NamaDosen.Text = "Hotman S.kom"
Case "999"
NamaDosen.Text = "Yasir M.kom"
Case Else
NamaDosen.Text = "_"
End Select
End Sub
Private Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.Click
NilaiAkhir.Text = 0.4 * NilaiUTS.Text + 0.6 * NilaiUAS.Text + 0.1 * NilaiKehadiran.Text + 0.15 * NilaiTugas.Text
If NilaiAkhir.Text >= 80 Then
NilaiHuruf.Text = "A"
ElseIf NilaiAkhir.Text >= 70 Then
NilaiHuruf.Text = "B"
ElseIf NilaiAkhir.Text >= 60 Then
NilaiHuruf.Text = "C"
ElseIf NilaiAkhir.Text >= 50 Then
NilaiHuruf.Text = "D"
Else
NilaiHuruf.Text = "E"
End If
If NilaiAkhir.Text >= 50 Then
Keterangan.Text = "Lulus"
Else
Keterangan.Text = "Gagal"
End If
If Jenjang.Text = "1" Then
Jenjang.Text = "Diploma 1"
ElseIf Jenjang.Text = "3" Then
Jenjang.Text = "Diploma 3"
ElseIf Jenjang.Text = "4" Then
Jenjang.Text = "Strata 1"
End If
If Jurusan.Text = "01" Then
Jurusan.Text = "Manajemen Informatika"
ElseIf Jurusan.Text = "02" Then
Jurusan.Text = "Sistem Informatika"
ElseIf Jurusan.Text = "03" Then
Jurusan.Text = "Teknik komputer"
ElseIf Jurusan.Text = "04" Then
Jurusan.Text = "Akuntansi"
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 = ""
KodeDosen.Text = ""
NamaDosen.Text = ""
KodeMatakuliah.Text = ""
NamaMatakuliah.Text = ""
NilaiKehadiran.Text = ""
NilaiTugas.Text = ""
NilaiUTS.Text = ""
NilaiUAS.Text = ""
NilaiAkhir.Text = ""
NilaiHuruf.Text = ""
Keterangan.Text = ""
End Sub
Private Sub NilaiUAS_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles NilaiUAS.KeyPress
Dim tombol As Integer = Asc(e.KeyChar)
If tombol = 13 Then
Btnproses_Click(sender, e)
End If
End Sub
Private Sub KodeMatakuliah_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KodeMatakuliah.SelectedIndexChanged
Select Case KodeMatakuliah.Text
Case "A23"
NamaMatakuliah.Text = "Sistem Basis data"
Case "A24"
NamaMatakuliah.Text = "matriks linier transformasi"
Case "A25"
NamaMatakuliah.Text = "Programan visual"
Case "A26"
NamaMatakuliah.Text = "Teknik Informatika"
Case "A27"
NamaMatakuliah.Text = "Managemen Sistem"
Case "A28"
NamaMatakuliah.Text = "teknik digital"
Case "A29"
NamaMatakuliah.Text = "visual basic"
Case Else
NamaMatakuliah.Text = "_"
End Select
End Sub
Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
End
End Sub
Private Sub NilaiUAS_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NilaiUAS.SelectedIndexChanged
End Sub
End Class
link pak mesran
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar