Catatan Kuliahku (VB.NET)




















Public Class Form1

Private Sub btn_total_nilai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_total_nilai.Click

Dim uts, uas, tgs As Integer

Dim nilai As Double

uts = txt_nilai_uts.Text

uas = txt_nilai_uas.Text

tgs = txt_nilai_tgs.Text

nilai = (uts * 0.3) + (uas * 0.5) + (tgs * 0.5) / 3

txt_nilai.Text = (nilai)

End Sub

Private Sub txt_nilai_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_nilai.TextChanged

Dim nilai As Integer

nilai = txt_nilai.Text

Dim grade As String = lbl_grade.Text

If nilai <= 50 Then

lbl_grade.Text = "E"

MessageBox.Show("Tidak Lulus")

ElseIf nilai < 50 Then

lbl_grade.Text = "D"

MessageBox.Show("Tidak Lulus")

ElseIf nilai < 60 Then

lbl_grade.Text = "C"

MessageBox.Show("Tidak Lulus")

ElseIf nilai < 70 Then

lbl_grade.Text = "B"

MessageBox.Show("Lulus")

ElseIf nilai < 80 Then

lbl_grade.Text = "B+"

MessageBox.Show("Lulus")

Else

lbl_grade.Text = "A"

MessageBox.Show("Lulus")

End If

End Sub

End Class







Tidak ada komentar:

Posting Komentar