Sunday, 29 November 2015

Yuk! Belajar Pemrograman Visual Basic dot Net Di Mesran.Net

  Selesaikanlah Kasus Berikut : Latihan Praktikum Listview Pembayaran Tagihan PDAM


Berikut adalah jawaban program :




dengan coding


Public Class Form1

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


        lv.Columns.Add("Kode", 80, HorizontalAlignment.Center)
        lv.Columns.Add("Nama", 100, HorizontalAlignment.Left)
        lv.Columns.Add("Tipe", 100, HorizontalAlignment.Left)
        lv.Columns.Add("Jumlah Pemakaian", 130, HorizontalAlignment.Left)
        lv.Columns.Add("Biaya Beban", 100, HorizontalAlignment.Left)
        lv.Columns.Add("Harga", 100, HorizontalAlignment.Left)
        lv.Columns.Add("Total Tagihan", 100, HorizontalAlignment.Left)
        lv.Columns.Add("Pajak", 100, HorizontalAlignment.Left)
        lv.Columns.Add("Pembayaran", 100, HorizontalAlignment.Left)

        lv.GridLines = True
        lv.View = View.Details
        lv.FullRowSelect = True

        kode.Items.Add("001")
        kode.Items.Add("002")
        kode.Items.Add("003")

        tipe.Items.Add("Rumah")
        tipe.Items.Add("Toko")
        tipe.Items.Add("Pabrik")

        nama.Enabled = False
        biaya.Enabled = False
        harga.Enabled = False
        total.Enabled = False
        pajak.Enabled = False
        pembayaran.Enabled = False
    End Sub

    Private Sub kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kode.SelectedIndexChanged
        Select Case kode.Text
            Case "001"
                nama.Text = "Barik Alwi NST"
            Case "002"
                nama.Text = "Winda"
            Case "003"
                nama.Text = "Septiana"
            Case Else
                nama.Text = ""
        End Select
    
End Sub

    Private Sub tipe_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tipe.SelectedIndexChanged
        Select Case tipe.Text
            Case "Toko"
                biaya.Text = 25000
                harga.Text = 300
            Case "Rumah"
                biaya.Text = 15000
                harga.Text = 100
            Case "Pabrik"
                biaya.Text = 25000
                harga.Text = 500
        End Select
    End Sub

    Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
        total.Text = Val(biaya.Text) + harga.Text * jpemakaian.Text
        pajak.Text = 0.1 * total.Text
        pembayaran.Text = Val(total.Text) + Val(pajak.Text)

        Dim lst As New ListViewItem
        lst.Text = kode.Text
        lst.SubItems.Add(nama.Text)
        lst.SubItems.Add(tipe.Text)
        lst.SubItems.Add(jpemakaian.Text)
        lst.SubItems.Add(biaya.Text)
        lst.SubItems.Add(harga.Text)
        lst.SubItems.Add(total.Text)
        lst.SubItems.Add(pajak.Text)
        lst.SubItems.Add(pembayaran.Text)
        lv.Items.Add(lst)
    End Sub

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

    Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
        lv.Items.Clear()

    End Sub

    Private Sub btnbatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbatal.Click
        kode.Text = ""
        nama.Text = ""
        tipe.Text = ""
        jpemakaian.Text = ""
        biaya.Text = ""
        harga.Text = ""
        total.Text = ""
        pajak.Text = ""
        pembayaran.Text = ""

    End Sub
End Class

Demikilahlah postingan saya  Nama : (Barik Alwi Nst)  NPM : (14110212)

download text diatas : download

No comments :

Post a Comment