Visual Basic - Program Menghitung Nilai Hasil Ujian
Program menghitung Nilai Hasil Ujian
- Input : Tugas, UTS, UAS dan Jumlah Kehadiran
- Output : Rata-rata dan Hasil
- Rata-rata = (Tugas + UTS + UAS) / 3
- Hasil = Jika rata-rata <=60 atau jumlaah kehadiran < 12, maka Hasil = “Tidak Lulus” selain itu, Hasil = “Lulus”
Private Sub BBatal_Click()
TxtTugas = ""
TxtUTS = ""
TxtUAS = ""
TxtJumlah = ""
TxtRataRata = ""
TxtHasil = ""
End Sub
Private Sub BHitung_Click()
TxtRataRata.Text = Val((Val(TxtTugas.Text) + Val(TxtUAS.Text) + Val(TxtUTS.Text)) / 3)
If TxtJumlah.Text <= 12 Then
TxtHasil = "Tidak Lulus"
ElseIf TxtRataRata.Text <= 60 Then
TxtHasil = "Tidak Lulus"
Else
TxtHasil = "Lulus"
End If
End Sub
Private Sub BKeluar_Click()
Unload Me
End Sub