Selamat datang di fgex[dot]blogspot[dot]Com

Tugas Pemograman Visual Basic

Tuesday, November 19, 20130 komentar

Berikut Adalah, Latihan Membuat Tentang Bagaimana Cara untuk Memprogramkan Suatu Masalah Melalui "Program Visual Basic",


fgex.blogspot.com


 Gambar di atas adalah, sekedar memperlihatkan contoh hasil dari penyelesaian suatu masalah pemograman visual basic,, nah..,untuk lebih jelasnya, mari ikuti langkah-langkah berikut:


Berikut Scrip/Coding Programnya.

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        NPM.Items.Add("12110178")
        NPM.Items.Add("12110190")
        Kode_Dosen.Items.Add("AA")
        Kode_Dosen.Items.Add("AB")
        Kode_Matakuliah.Items.Add("A11")
        Kode_Matakuliah.Items.Add("A12")

        Dim i As Integer
        For i = 1 To 100
            Nilai_Kehadiran.Items.Add(i)
            Nilai_Tugas.Items.Add(i)
            Nilai_UTS.Items.Add(i)
            Nilai_UAS.Items.Add(i)
        Next i
    End Sub

    Private Sub NPM_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NPM.SelectedIndexChanged
        Select Case NPM.Text
            Case "12110178"
                Nama.Text = "Firman Gea"
            Case "12110190"
                Nama.Text = "Agus Z"
        End Select

        Dim x As String
        x = Microsoft.VisualBasic.Mid(NPM.Text, 3, 1)
        If x = "4" Then
            Jenjang.Text = "Diploma I"
        ElseIf x = "3" Then
            Jenjang.Text = " Diploma 3"
        ElseIf x = "1" Then
            Jenjang.Text = "Strata I"
        End If

        x = Microsoft.VisualBasic.Mid(NPM.Text, 4, 2)
        If x = "10" Then
            Jurusan.Text = "Teknik Komputer"
        ElseIf x = "11" Then
            Jurusan.Text = "Sistem Informas"
        ElseIf x = "12" Then
            Jurusan.Text = "Manajemen Informatika"
        ElseIf x = "13" Then
            Jurusan.Text = "Akuntansi"
        End If
    End Sub
    Private Sub Kode_Dosen_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Kode_Dosen.SelectedIndexChanged
        Select Case Kode_Dosen.Text
            Case "AA"
                Nama_Dosen.Text = "Mesran, M.Kom"
            Case "AB"
                Nama_Dosen.Text = "Toni Limbong, M.Kom"
        End Select
    End Sub

    Private Sub Kode_Matakuliah_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Kode_Matakuliah.SelectedIndexChanged
        Select Case Kode_Matakuliah.Text
            Case "A11"
                Nama_Matakuliah.Text = "Pemrograman Visual"
            Case "A12"
                Nama_Matakuliah.Text = "Pemrograman HTML"
        End Select
    End Sub

    Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click
        Nilai_Akhir.Text = 0.1 * Nilai_Kehadiran.Text + 0.15 * Nilai_Tugas.Text + 0.3 * Nilai_UTS.Text + 0.45 * Nilai_UAS.Text
    End Sub

    Private Sub Nilai_Akhir_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nilai_Akhir.TextChanged
        If Nilai_Akhir.Text >= "80" Then
            Nilai_Huruf.Text = "A"
            Keterangan.Text = "Sangat Memuaskan"
        ElseIf Nilai_Akhir.Text >= "70" Then
            Nilai_Huruf.Text = "B"
            Keterangan.Text = "Memuaskan"
        ElseIf Nilai_Akhir.Text >= "60" Then
            Nilai_Akhir.Text = "C"
            Keterangan.Text = "Menyenangkan"
        ElseIf Nilai_Akhir.Text >= "50" Then
            Nilai_Huruf.Text = "D"
            Keterangan.Text = "Menyedihkan"
        Else
            Nilai_Huruf.Text = "E"
            Keterangan.Text = "Gagal"
        End If
    End Sub

    Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click
        NPM.Text = ""
        Nama.Text = ""
        Jenjang.Text = ""
        Jurusan.Text = ""
        Kode_Dosen.Text = ""
        Nama_Dosen.Text = ""
        Kode_Matakuliah.Text = ""
        Nama_Matakuliah.Text = ""
        Nilai_Kehadiran.Text = ""
        Nilai_Tugas.Text = ""
        Nilai_UTS.Text = ""
        Nilai_UAS.Text = ""
        Nilai_Akhir.Text = ""
        Nilai_Huruf.Text = ""
        Keterangan.Text = ""
    End Sub

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

Share this article :

Post a Comment