links

zumrotulaqobahhsb.blogspot.com. Diberdayakan oleh Blogger.

Senin, 24 Juni 2013

TUGAS Q



Public Class Form1

    Private Sub CaesarChiperToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CaesarChiperToolStripMenuItem.Click
        Form3.MdiParent = Me
        Form3.Show()
    End Sub

    Private Sub VigenereToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VigenereToolStripMenuItem.Click
        Form2.MdiParent = Me
        Form2.Show()
    End Sub

    Private Sub GransfeldChiperToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GransfeldChiperToolStripMenuItem.Click
        Form4.MdiParent = Me
        Form4.Show()
    End Sub

    Private Sub VernamChiperToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VernamChiperToolStripMenuItem.Click
        Form5.MdiParent = Me
        Form5.Show()
    End Sub

    Private Sub DesChiperToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DesChiperToolStripMenuItem.Click
        Form6.MdiParent = Me
        Form6.Show()
    End Sub

    Private Sub RC4ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RC4ToolStripMenuItem.Click
        Form7.MdiParent = Me
        Form7.Show()
    End Sub

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

CAESAR CHIPER

Public Class Form3

    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        plain.Text = ""
        chiper.Text = ""
    End Sub

    Private Sub enkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles enkript.Click
        Dim jumlah As Double = Len(plain.Text)
        Dim x As String
        Dim xkalimat As String = ""
        Dim i As Double
        Dim bil As Integer
        For i = 1 To jumlah
            x = Mid(plain.Text, i, 1)
            bil = Asc(x) + 3
            x = Chr(bil)
            xkalimat = xkalimat + x
        Next i
        chiper.Text = xkalimat
    End Sub

    Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
        Close()
    End Sub
End Class
 

Minggu, 02 Juni 2013

HASIL PROGRAM SOAL NO 1.

HASIL PROGRAM SOAL NO 1.
LISTING PROGRAMNYA....:
Public Class Form2
    Sub buattabel()
        LV.Columns.Add("pembelian", 80, HorizontalAlignment.Center)
        LV.Columns.Add("kode barang", 80, HorizontalAlignment.Left)
        LV.Columns.Add("nama barang", 120, HorizontalAlignment.Left)
        LV.Columns.Add("merk", 80, HorizontalAlignment.Left)
        LV.Columns.Add("harga", 80, HorizontalAlignment.Left)
        LV.Columns.Add("jmlh beli", 80, HorizontalAlignment.Left)
        LV.Columns.Add("ttl harga", 80, HorizontalAlignment.Left)
        LV.View = View.Details
        LV.GridLines = True
        LV.FullRowSelect = True
    End Sub
    Sub isitable()
        Dim lst As New ListViewItem
        lst.Text = pembelian.Text
        lst.SubItems.Add(kd_brg.Text)
        lst.SubItems.Add(nm_brg.Text)
        lst.SubItems.Add(merk.Text)
        lst.SubItems.Add(harga.Text)
        lst.SubItems.Add(jlh_beli.Text)
        lst.SubItems.Add(ttl_harga.Text)
        LV.Items.Add(lst)
    End Sub

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        kd_brg.Items.Add("TS001")
        kd_brg.Items.Add("TS002")
        kd_brg.Items.Add("VG001")
        kd_brg.Items.Add("VG002")
        buattabel()
    End Sub

    Private Sub kd_brg_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kd_brg.SelectedIndexChanged
        Dim X As String
        X = Microsoft.VisualBasic.Left(kd_brg.Text, 2)
        Select Case X
            Case "TS" : merk.Text = "TOSIBA"
            Case "VG" : merk.Text = "V-GEN"
        End Select

        X = Microsoft.VisualBasic.Right(kd_brg.Text, 5)
        Select Case X
            Case "TS001" : nm_brg.Text = "FLASDISK 4 GB" : harga.Text = "1050000"
            Case "TS002" : nm_brg.Text = "FLASDISK 2 GB" : harga.Text = "75000"
            Case "VG001" : nm_brg.Text = "FLASDISK 4 GB" : harga.Text = "90000"
            Case "VG002" : nm_brg.Text = "FLASDISK 2 GB" : harga.Text = "60000"
        End Select
    End Sub
    Private Sub simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan.Click
        ttl_harga.Text = harga.Text * jlh_beli.Text
        isitable()
        pembelian.Text = ""
        kd_brg.Text = ""
        nm_brg.Text = ""
        merk.Text = ""
        harga.Text = ""
        jlh_beli.Text = ""
        ttl_harga.Text = ""
    End Sub

    Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
        Close()
    End Sub

    Private Sub hps_data_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hps_data.Click
        LV.Items.Clear()
    End Sub

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