Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbNim.SelectedIndexChanged
Dim NIM1, NIM2, NIM3 As Integer
NIM1 = 1411500331
NIM2 = 1412500413
NIM3 = 1413500347
If cmbNim.Text = NIM1 Then
txtNama.Text = "Ahmad Galil Pramudito"
txtJenjang.Text = "S-1"
txtJurusan.Text = "Teknik Informasi"
ElseIf cmbNim.Text = NIM2 Then
txtNama.Text = "Abdilah Sanad"
txtJenjang.Text = "S-1"
txtJurusan.Text = "Sistem Informasi"
ElseIf cmbNim.Text = NIM3 Then
txtNama.Text = "Chairul Anwar"
txtJenjang.Text = "S-1"
txtJurusan.Text = "Teknik Informasi"
End If
End Sub
Sub Loop_Kehadiran()
Dim batasAwal, BatasAkhir, textStep As Integer
batasAwal = 0
BatasAkhir = 100
textStep = 10
Do While batasAwal <= BatasAkhir
Me.cmbNilaiKehadiran.Items.Add(batasAwal)
Me.cmbTugas.Items.Add(batasAwal)
Me.cmbUTS.Items.Add(batasAwal)
Me.cmbUAS.Items.Add(batasAwal)
batasAwal += textStep
Loop
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.cmbNilaiKehadiran.SelectedValue = 0
Me.cmbTugas.SelectedValue = 0
Me.cmbUTS.SelectedValue = 0
Me.cmbUAS.SelectedValue = 0
Loop_Kehadiran()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Kehadiran, Tugas, UTS, UAS, Nilai_Kehadiran, Nilai_Tugas, Nilai_UTS, Nilai_UAS, Hasil As Integer
Dim Kelulusan, Nilai_Akhir As String
Kehadiran = Integer.Parse(cmbNilaiKehadiran.Text)
Tugas = Integer.Parse(cmbTugas.Text)
UTS = Integer.Parse(cmbUTS.Text)
UAS = Integer.Parse(cmbUAS.Text)
' Absen Kehadiran 10%
Nilai_Kehadiran = ((Kehadiran * 10) / 100)
' Tugas 20%
Nilai_Tugas = ((Tugas * 20) / 100)
' UTS 30%
Nilai_UTS = ((UTS * 30) / 100)
' UAS 40%
Nilai_UAS = ((UAS * 40) / 100)
Hasil = (Nilai_Kehadiran + Nilai_Tugas + Nilai_UTS + Nilai_UAS)
If Hasil >= 85 And Hasil <= 100 Then
Nilai_Akhir = "A"
Kelulusan = "Lulus"
ElseIf Hasil >= 75 And Hasil <= 85 Then
Nilai_Akhir = "B"
Kelulusan = "Lulus"
ElseIf Hasil >= 60 And Hasil <= 75 Then
Nilai_Akhir = "C"
Kelulusan = "Lulus"
ElseIf Hasil >= 45 And Hasil <= 60 Then
Nilai_Akhir = "D"
Kelulusan = "Tidak Lulus"
ElseIf Hasil >= 0 And Hasil <= 45 Then
Nilai_Akhir = "E"
Kelulusan = "Tidak Lulus"
End If
lblNilaiAkhir.Text = Hasil
lblNilaiHuruf.Text = Nilai_Akhir
lblKelulusan.Text = Kelulusan
End Sub
Tidak ada komentar:
Posting Komentar