Selasa, 12 November 2013

TUGAS PEMROGRAMAN VISUAL BASIC

Pemrograman Visual Basic

Langkah-langkahnya:

1. Buka program VB (Visual basic)
2. klik create: New Project
3.ubah Project dengan nama yang Anda inginkan
4. Setelah itu akan muncul form1 pada project kita
5. Desain form1 tersebut dengan pembuatan  Label, TextBox, Combobox, Button,dll.
Sekarang kita desain form seperti di bawah ini.

 

Listing programnya!!

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        NPM.Items.Add("12110495")
        NPM.Items.Add("12110677")
        NPM.Items.Add("12110434")
        NPM.Items.Add("12111012")
        NPM.Items.Add("12110460")

        KDosen.Items.Add("41432")
        KDosen.Items.Add("41433")
        KDosen.Items.Add("41434")
        KDosen.Items.Add("41435")
        KDosen.Items.Add("41436")

        Kdemtkul.Items.Add("KKTI4303")
        Kdemtkul.Items.Add("KBTI4306")
        Kdemtkul.Items.Add("KBTI4303")
        Kdemtkul.Items.Add("KBTI4305")
        Kdemtkul.Items.Add("KBTI4301")

        Dim x As Integer
        For x = 1 To 100
            Nhadir.Items.Add(x)
            Ntugas.Items.Add(x)
            Nuts.Items.Add(x)
            Nuas.Items.Add(x)
        Next x
    End Sub

    Private Sub NPM_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NPM.SelectedIndexChanged
        Select Case NPM.Text
            Case "12110495"
                Nama.Text = "Dessy Oktryana Sitorus"
            Case "12110677"
                Nama.Text = "Evi Rida Maha"
            Case "12110434"
                Nama.Text = "Devie Puspita"
            Case "12111012"
                Nama.Text = "Rizky Mawarni"
            Case "12110460"
                Nama.Text = "Vermina Marbun"
        End Select
        Jenjang.Text = "SI"
        jurusan.Text = "Teknik Informatika"
    End Sub

    Private Sub KDosen_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KDosen.SelectedIndexChanged
        Select Case KDosen.Text
            Case "41432"
                NmDosen.Text = "Tonny Limbong,S.Kom,M.Kom"
            Case "41433"
                NmDosen.Text = "Alex Rikki,S.Kom,M.Kom"
            Case "41434"
                NmDosen.Text = "Yasir Hasan,S.Kom"
            Case "41435"
                NmDosen.Text = "Mesran,M.Kom"
            Case "41436"
                NmDosen.Text = "Pristiwanto,S.Kom"
        End Select
    End Sub

    Private Sub Kdemtkul_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Kdemtkul.SelectedIndexChanged
        Select Case Kdemtkul.Text
            Case "KBTI4303"
                Mkul.Text = "Sistem Basis Data"
            Case "KKTI4303"
                Mkul.Text = "Struktur Data"
            Case "KBTI4306"
                Mkul.Text = "Sistem Operasi"
            Case "KBTI4305"
                Mkul.Text = "Pemograman Visual"
            Case "KBTI4302"
                Mkul.Text = "Komunikasi Data"
        End Select
    End Sub

    Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
        End
    End Sub

    Private Sub Nhadir_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nhadir.SelectedIndexChanged

    End Sub

    Private Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.Click
        Nakhir.Text = 0.1 * Nhadir.Text + 0.15 * Ntugas.Text + 0.35 * Nuts.Text + 0.45 * Nuas.Text

        If Nakhir.Text >= 80 Then
            Nhuruf.Text = "A"
            Keterangan.Text = "LULUS"
        ElseIf Nakhir.Text >= 70 Then
            Nhuruf.Text = "B"
            Keterangan.Text = "LULUS"
        ElseIf Nakhir.Text >= 60 Then
            Nhuruf.Text = "C"
            Keterangan.Text = "LULUS"
        ElseIf Nakhir.Text >= 50 Then
            Nhuruf.Text = "D"
            Keterangan.Text = "GAGAL"
        Else
            Nhuruf.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 = ""
        KDosen.Text = ""
        NmDosen.Text = ""
        Kdemtkul.Text = ""
        Mkul.Text = ""
        Nhadir.Text = ""
        Ntugas.Text = ""
        Nuts.Text = ""
        Nuas.Text = ""
        Nakhir.Text = ""
        Nhuruf.Text = ""
        Keterangan.Text = ""
    End Sub

End Class

Setelah kita jalankan, hasilnya seperti berikut ini:

Tidak ada komentar:

Posting Komentar