Jumat, 27 Januari 2012

jawaban soal 3 (nina serly)

listing login


Public Class Form1

    Private Sub BtnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOk.Click
        If Username.Text = "nina" And Pasword.Text = "352" Then
            formMenu.Show()
            Me.Hide()
        Else
            MsgBox("Maaf! Pasword Salah!")
            Username.Text = ""
            Pasword.Text = ""
        End If
    End Sub

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

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

    End Sub
End Class


listing menu

Public Class formMenu

    Private Sub DataPenggaianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataPenggaianToolStripMenuItem.Click
        Pegawai.Show()
    End Sub

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

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

    End Sub
End Class


listing penggajian

Public Class Pegawai
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        BuaTable()
        NIP.Items.Add("001")
        NIP.Items.Add("002")
        Gol.Items.Add("IIIA")
        Gol.Items.Add("IIIB")
        Gol.Items.Add("IIIC")
        Jabatan.Items.Add("Kasut")
        Jabatan.Items.Add("Kabag")
        Status.Items.Add("MENIKAH")
        Status.Items.Add("LAJANG")
        lbr.Text = "10.000"
    End Sub

    Private Sub nip_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NIP.SelectedIndexChanged
        If NIP.Text = "001" Then Nama.Text = ("Dian") Else Nama.Text = ("Siska")
    End Sub

    Private Sub gol_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Gol.SelectedIndexChanged
        If Gol.Text = ("IIIA") Then
            Gaji.Text = ("2500000")
        ElseIf Gol.Text = ("IIIB") Then
            Gaji.Text = ("2750000")
        Else : Gaji.Text = ("3000000")
        End If
    End Sub
    Private Sub BtnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOK.Click
        isiTable()
        NIP.Text = ""
        Nama.Text = ""
        Gol.Text = ""
        Jabatan.Text = ""
        Gaji.Text = ""
        Tunjangan.Text = ""
        Total.Text = ""
    End Sub
    Sub BuaTable()
        LV.Columns.Add("N.I.P", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Nama", 100, HorizontalAlignment.Center)
        LV.Columns.Add("Golongan", 40, HorizontalAlignment.Center)
        LV.Columns.Add("Jabatan", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Gaji", 100, HorizontalAlignment.Center)
        LV.Columns.Add("Tunjangan", 100, HorizontalAlignment.Center)
        LV.Columns.Add("Total Gaji", 100, HorizontalAlignment.Right)
        LV.Columns.Add("Lembur", 40, HorizontalAlignment.Right)
        LV.View = View.Details
        LV.GridLines = True
        LV.FullRowSelect = True
    End Sub
    Sub isiTable()
        Dim Lst As New ListViewItem
        Lst.Text = NIP.Text
        Lst.SubItems.Add(Nama.Text)
        Lst.SubItems.Add(Gol.Text)
        Lst.SubItems.Add(Jabatan.Text)
        Lst.SubItems.Add(Gaji.Text)
        Lst.SubItems.Add(Tunjangan1.Text)
        Lst.SubItems.Add(Total.Text)
        Lst.SubItems.Add(lbr.Text)
        LV.Items.Add(Lst)
    End Sub
    Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click
        LV.Items.Remove(LV.SelectedItems(0))
    End Sub

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

    Private Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Status.SelectedIndexChanged
        If Status.Text = "LAJANG" Then
            J_Anak.Text = 0
            Tunjangan1.Text = 0
            Tunjangan.Text = 0
        ElseIf Status.Text = "MENIKAH" Then
            Tunjangan1.Text = Val(Gaji.Text) * 0.16
        End If
    End Sub

    Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click
        pajak.Text = Val(Gaji.Text) * 0.03
        Total.Text = Val(Gaji.Text) + Val(Tunjangan1.Text) + Val(Tunjangan.Text) + (Val(lbr.Text) * Val(jm.Text)) - Val(pajak.Text)
        If J_Anak.Text = 0 Then
            Tunjangan.Text = 0
        ElseIf J_Anak.Text = 1 Then
            Tunjangan.Text = J_Anak.Text * (0.1 * Gaji.Text)
        ElseIf J_Anak.Text = 2 Then
            Tunjangan.Text = 2 * (0.19 * Gaji.Text)
        End If
    End Sub
End Class





kembali ke  soal 

jawaban soal 2 (nina serly)

listimg program


Public Class Form1
    Sub BuatTable()
        LV.Columns.Add("NPM", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Nama", 180, HorizontalAlignment.Left)
        LV.View = View.Details
        LV.GridLines = True
        LV.FullRowSelect = True
    End Sub
    Sub IsiTable()
        Dim Lst As New ListViewItem
        Lst.Text = NPM.Text
        Lst.SubItems.Add(Nama.Text)
        LV.Items.Add(Lst)
    End Sub

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

    Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click
        IsiTable()
        NPM.Text = ""
        Nama.Text = ""
    End Sub
   
    Private Sub btnHapusAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapusAll.Click
        LV.Items.Clear()
    End Sub

    Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click
        LV.Items.Remove(LV.SelectedItems(0))
    End Sub
End Class