Senin, 25 Januari 2016

MENCARI NILAI UAS , UTS DAN KETERANGAN_LATIHAN 5

ASSALAMU'ALAIKUM WARAHMATULLAHI WABAROKATUH :)
 
SELAMAT DATANG DI BLOG SAYA, SAYA AKAN MEMPOSTING MENGENAI  PROGRAM VISUAL BASIC 10 YANG SAYA BUAT

PROJECT LATIHAN 5
 
MENCARI NILAI UAS , UTS DAN KETERANGAN





 BERIKUT ADALAH CODING CARA MENCARI NILAI UAS, UTS DAN KETERANGAN
Public Class Lat5
    Dim UTS, UAS, NA As Double
    Dim Kelakuan, Kehadiran As Integer
    Dim KNA, Kujian, Khadir, Kkelakuan As Boolean
    Dim Keterangan As String

    Sub lulus()
        UTS = Val(Me.TxtUTS.Text)
        UAS = Val(Me.TxtUAS.Text)
        Kehadiran = Val(Me.TxtKH.Text)
        Kelakuan = Val(Me.TxtKL.Text)

        NA = (UTS * 0.4) + (UAS * 0.6)
        Me.TxtNA.Text = NA.ToString
        If UTS > 0 And UAS > 0 Then
            Kujian = True
        Else
            Kujian = False
        End If
        If Kehadiran > (0.75 * 18) Then
            Khadir = True
        Else
            Khadir = False
        End If
        If Kelakuan >= 2 Then
            Kkelakuan = True
        Else
            Kkelakuan = False
        End If
        If NA > 50 Then
            KNA = True
        Else
            KNA = False
        End If
        If Kujian = True And Khadir = True And Kkelakuan = True And KNA = True Then
            Keterangan = "Lulus"
        Else
            Keterangan = "Gagal"

        End If
        Me.TxtKET.Text = Keterangan.ToString
    End Sub
   
    Private Sub TxtUTS_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtUTS.TextChanged
        Call lulus()
    End Sub

    Private Sub TxtUAS_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtUAS.TextChanged
        Call lulus()
    End Sub

    Private Sub TxtKH_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtKH.TextChanged
        Call lulus()
    End Sub

    Private Sub TxtKL_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtKL.TextChanged
        Call lulus()
    End Sub

    Private Sub Lat5_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        utama.Enabled = True
        utama.Show()
        Me.Hide()
    End Sub

    Private Sub Lat5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

End Class
 

Tidak ada komentar:

Posting Komentar