Laman

Sabtu, 07 April 2012

Contoh Program Mneghitung DNS Pada VB.Net Console

Contoh Program Mneghitung DNS Pada VB.Net Console




Module Module1

    Sub Main()
        Dim UTS, UAS As Integer
        Dim DNS As Long
        Console.Write("Masukan Nilai UTS Anda: ")
        UTS = Console.ReadLine
        Console.Write("Masukan Nilai UAS Anda: ")
        UAS = Console.ReadLine
        Console.WriteLine("===========================")
        Console.WriteLine("")

        DNS = (0.7 * UTS) + (0.3 * UAS)

        Select Case DNS
            Case Is >= 80
                Console.WriteLine("      Selamat Anda LULUS!")
                Console.WriteLine("     Anda Mendapat Nilai A")
            Case Is >= 70
                Console.WriteLine("     Selamat Anda LULUS!")
                Console.WriteLine("    Anda Mendapat Nilai B")
            Case Is >= 60
                Console.WriteLine("      Selamat Anda LULUS!")
                Console.WriteLine("     Anda Mendapat Nilai C")
            Case Is >= 50
                Console.WriteLine("      Selamat Anda LULUS!")
                Console.WriteLine("     Anda Mendapat Nilai D")
            Case Else
                Console.WriteLine("  Maaf Anda TIDAK LULUS!")
        End Select
        Console.Write("Nilai Anda Pada DNS adalah: ")
        Console.WriteLine(DNS)
        Console.WriteLine("===============================")
        Console.ReadLine()
    End Sub

End Module





COntoh :

Masukan Nilai UTS Anda: 78
Masukan Nilai UAS Anda: 46
===========================

      Selamat Anda LULUS!
     Anda Mendapat Nilai C
Nilai Anda Pada DNS adalah: 68
===============================

Tidak ada komentar:

Posting Komentar