Portal Informatika | Sharing Tugas | Sharing Aplikasi | Sharing Informasi tentang Teknologi dan Aplikasi

Selasa, 16 Oktober 2012

MENGHITUNG NILAI IPK MENGGUNAKAN VB.2008

Posted by Unknown On 20.25 No comments


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        lblipkakhir.Text = ((Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text)) / 8)

        Dim ipk As Double
        ipk = lblipkakhir.Text
        If ipk >= 3.51 Then
            lblpredikat.Text = "Cumlaude"
        ElseIf ipk > 3 And ipk <= 3.5 Then
            lblpredikat.Text = "Sangat Memuaskan"
        ElseIf ipk > 2.5 And ipk <= 3 Then
            lblpredikat.Text = "Memuaskan"
        ElseIf ipk <= 2.49 Then
            lblpredikat.Text = "Kuliah lagi kamu!!"

        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        lblipkakhir.Text = ""
        lblpredikat.Text = ""

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        End
    End Sub
End Class




0 komentar:

Posting Komentar