The Sims 3 - New Real House

Pemrograman 2

Nama TextBox 1 : uts
Nama TextBox 2 : uas
Nama TextBox 3 : tgs
Nama TextBox 4 : absen
Nama TextBox 5 : NA
Nama TextBox 6 : HM
Nama TextBox 7 : Ket


Public Class Tugas2
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cek.Click
        NA.Text = Val(uts.Text * 0.3) + Val(uas.Text * 0.3) + Val(tgs.Text * 0.3) + Val(absen.Text * 0.1)
        If NA.Text >= 80 Then
            HM.Text = "A"
        ElseIf NA.Text >= 70 Then
            HM.Text = "B"
        ElseIf NA.Text >= 56 Then
            HM.Text = "C"
        ElseIf NA.Text >= 40 Then
            HM.Text = "D"
        Else
            HM.Text = "E"
        End If
        If HM.Text = "A" Then
            Ket.Text = "Baik Sekali"
        ElseIf HM.Text = "B" Then
            Ket.Text = "Baik"
        ElseIf HM.Text = "C" Then
            Ket.Text = "Cukup"
        ElseIf HM.Text = "D" Then
            Ket.Text = "Kurang"
        Else
            Ket.Text = "Sangat Kurang"
        End If
    End Sub
End Class

Komentar