Jumat, 05 Desember 2014

Program Sederhana Penjualan Mobil Secara Kredit Menggunakan VB.Net 2008

Sekarang saya akan memposting Program Sederhana Penjualan Mobil Secara Kredit Menggunakan VB.Net 2008. Okey langsung saja gan,
1. Tampilan Form Penjualan Mobil Secara Kredit


2. Listing Program

Public Class Form1

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

        Kode.Items.Add("MB1")
        Kode.Items.Add("MB2")
        Kode.Items.Add("MB3")
        Kode.Items.Add("MB4")

        For i = 2012 To 2014
            Tahun.Items.Add(i)
        Next

        Status.Items.Add("Baru")
        Status.Items.Add("Bekas")

        For x = 12 To 48
            LamaKredit.Items.Add(x)
        Next

        Call BuatTabel()
    End Sub

    Sub Bersih()
        Kode.Text = ""
        Mobil.Text = ""
        Tahun.Text = ""
        Status.Text = ""
        Harga.Text = ""
        Jumlah.Text = ""
        TotalHarga.Text = ""
        UangMuka.Text = ""
        KomisiSales.Text = ""
        TotalKredit.Text = ""
        LamaKredit.Text = ""
        Angsuran.Text = ""
        Kode.Focus()
    End Sub

    Sub BuatTabel()
        With LV
            .GridLines = True
            .View = View.Details
            .FullRowSelect = True
            .Columns.Add("Kode", 100)
            .Columns.Add("Nama Mobil", 130)
            .Columns.Add("Tahun", 100)
            .Columns.Add("Status", 100)
            .Columns.Add("Harga", 100)
            .Columns.Add("Jumlah", 100)
            .Columns.Add("Total Harga", 100)
            .Columns.Add("Uang Muka", 100)
            .Columns.Add("Komisi Sales", 100)
            .Columns.Add("Total Kredit", 100)
            .Columns.Add("Lama Kredit", 100)
            .Columns.Add("Angsuran / Bulan", 100)
        End With
    End Sub

    Sub isitabel()
        Dim lst As New ListViewItem
        With lst
            .Text = Kode.Text
            .SubItems.Add(Mobil.Text)
            .SubItems.Add(Tahun.Text)
            .SubItems.Add(Status.Text)
            .SubItems.Add(Harga.Text)
            .SubItems.Add(Jumlah.Text)
            .SubItems.Add(TotalHarga.Text)
            .SubItems.Add(UangMuka.Text)
            .SubItems.Add(KomisiSales.Text)
            .SubItems.Add(TotalKredit.Text)
            .SubItems.Add(LamaKredit.Text)
            .SubItems.Add(Angsuran.Text)
        End With
        LV.Items.Add(lst)
        Bersih()
    End Sub

    Private Sub Kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Kode.SelectedIndexChanged
        Select Case Kode.Text
            Case "MB1"
                Mobil.Text = "Avanza Veloz"
            Case "MB2"
                Mobil.Text = "Avanza G"
            Case "MB3"
                Mobil.Text = "Zenia"
            Case "MB4"
                Mobil.Text = "Yaris"
        End Select
    End Sub

    Private Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Status.SelectedIndexChanged
        If Kode.Text = "MB1" And Tahun.Text = "2012" And Status.Text = "Baru" Then
            Harga.Text = 175000000
        ElseIf Kode.Text = "MB1" And Tahun.Text = "2012" And Status.Text = "Bekas" Then
            Harga.Text = 120000000
        ElseIf Kode.Text = "MB1" And Tahun.Text = "2013" And Status.Text = "Baru" Then
            Harga.Text = 195000000
        ElseIf Kode.Text = "MB1" And Tahun.Text = "2013" And Status.Text = "Bekas" Then
            Harga.Text = 130000000
        ElseIf Kode.Text = "MB1" And Tahun.Text = "2014" And Status.Text = "Baru" Then
            Harga.Text = 208000000
        ElseIf Kode.Text = "MB1" And Tahun.Text = "2014" And Status.Text = "Bekas" Then
            Harga.Text = 170000000

        ElseIf Kode.Text = "MB2" And Tahun.Text = "2012" And Status.Text = "Baru" Then
            Harga.Text = 180000000
        ElseIf Kode.Text = "MB2" And Tahun.Text = "2012" And Status.Text = "Bekas" Then
            Harga.Text = 125000000
        ElseIf Kode.Text = "MB2" And Tahun.Text = "2013" And Status.Text = "Baru" Then
            Harga.Text = 200000000
        ElseIf Kode.Text = "MB2" And Tahun.Text = "2013" And Status.Text = "Bekas" Then
            Harga.Text = 135000000
        ElseIf Kode.Text = "MB2" And Tahun.Text = "2014" And Status.Text = "Baru" Then
            Harga.Text = 220000000
        ElseIf Kode.Text = "MB2" And Tahun.Text = "2014" And Status.Text = "Bekas" Then
            Harga.Text = 180000000

        ElseIf Kode.Text = "MB3" And Tahun.Text = "2012" And Status.Text = "Baru" Then
            Harga.Text = 160000000
        ElseIf Kode.Text = "MB3" And Tahun.Text = "2012" And Status.Text = "Bekas" Then
            Harga.Text = 115000000
        ElseIf Kode.Text = "MB3" And Tahun.Text = "2013" And Status.Text = "Baru" Then
            Harga.Text = 180000000
        ElseIf Kode.Text = "MB3" And Tahun.Text = "2013" And Status.Text = "Bekas" Then
            Harga.Text = 125000000
        ElseIf Kode.Text = "MB3" And Tahun.Text = "2014" And Status.Text = "Baru" Then
            Harga.Text = 200000000
        ElseIf Kode.Text = "MB3" And Tahun.Text = "2014" And Status.Text = "Bekas" Then
            Harga.Text = 160000000

        ElseIf Kode.Text = "MB4" And Tahun.Text = "2012" And Status.Text = "Baru" Then
            Harga.Text = 200000000
        ElseIf Kode.Text = "MB4" And Tahun.Text = "2012" And Status.Text = "Bekas" Then
            Harga.Text = 150000000
        ElseIf Kode.Text = "MB4" And Tahun.Text = "2013" And Status.Text = "Baru" Then
            Harga.Text = 230000000
        ElseIf Kode.Text = "MB4" And Tahun.Text = "2013" And Status.Text = "Bekas" Then
            Harga.Text = 135000000
        ElseIf Kode.Text = "MB4" And Tahun.Text = "2014" And Status.Text = "Baru" Then
            Harga.Text = 245000000
        ElseIf Kode.Text = "MB4" And Tahun.Text = "2014" And Status.Text = "Bekas" Then
            Harga.Text = 180000000
        End If
    End Sub

    Private Sub Jumlah_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jumlah.TextChanged
        If Harga.Text = "" Then
            Exit Sub
            Status.Focus()
        Else
            TotalHarga.Text = Jumlah.Text * Harga.Text
            UangMuka.Text = 0.3 * TotalHarga.Text
            KomisiSales.Text = 0.02 * Jumlah.Text * UangMuka.Text
            TotalKredit.Text = (TotalHarga.Text - UangMuka.Text)
        End If
    End Sub

    Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click
        Angsuran.Text = (((TotalKredit.Text) * (0.03 * LamaKredit.Text))) + Val(TotalKredit.Text) / LamaKredit.Text
    End Sub

    Private Sub BtnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSimpan.Click
        Call isitabel()
    End Sub

    Private Sub BtnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBatal.Click
        Bersih()
    End Sub

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

    Private Sub BtnHapusPerKode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapusPerKode.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
        Me.Close()
    End Sub
End Class


3. Hasil Program




Selasa, 02 Desember 2014

Program Sederhana Metode Kriptografi Caesar Menggunakan VB.Net 2008

Metode Caesar  seperti yang kita ketahui adalah salah satu teknik enkripsipaling sederhana dan paling terkenal. Sandi ini termasuk sandi substitusi dimana setiap huruf pada teks terang (plaintext) digantikan oleh huruf lain yang memiliki selisih posisi tertentu dalam alfabet. Misalnya, jika menggunakan geseran 3, Wakan menjadi Z, I menjadi L, dan K menjadi N sehingga teks terang "wiki" akan menjadi "ZLNL" pada teks tersandi. NamaCaesar diambil dari Julius Caesar, jenderal, konsul, dan diktator Romawi yang menggunakan sandi ini untuk berkomunikasi dengan para panglimanya.

Berikut contoh program Metode Kriptografi Caesar Menggunakan VB.Net 2008.

1. Tampilan Form Kriptografi Caesar


2. Listing Program

Private Sub BtnEnkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim teks As String = ""
        Dim i As Integer
        Dim xkar As String = ""
        For i = 1 To Len(Plaintext.Text)
            xkar = Mid(Plaintext.Text, i, 1)
            xkar = Chr(Asc(xkar) + 3)
            teks = teks + xkar
        Next
        Chipertext.Text = teks
        Plaintext.Text = ""
    End Sub

    Private Sub BtnDeskripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim teks As String = ""
        Dim i As Integer
        Dim xkar As String = ""
        For i = 1 To Len(Chipertext.Text)
            xkar = Mid(Chipertext.Text, i, 1)
            xkar = Chr(Asc(xkar) - 3)
            teks = teks + xkar
        Next
        Plaintext.Text = teks
        Chipertext.Text = ""
    End Sub

3. Hasil Program





Sekian dulu, terima kasih dan semoga bermanfaat.




Penggunaan Perulangan For Pada Pascal

Gan, sudah lama tak jumpa,,,,
kwkwkwkw.... :)

Okey kita mulai saja membuat suatu yang bermanfaat dalam bahasa program pascal atau lebih sering dikenal dengan layar biru. Disini saya akan membuat beberapa contoh program sederhana penggunaan Perulangan For pada Pascal.

======================================================
uses crt;
var
i : integer;
begin
clrscr;
for i := 1 To 5 Do
writeln(i);
readln;
end.

======================================================
uses crt;
var
i : integer;
begin
clrscr;
for i := 1 To 5 Do
writeln(i, 'Belajar bersama-sama');
readln;
end.

======================================================
uses crt;
var
i : integer;
begin
clrscr;
for i := 5 DownTo 1 Do
writeln(i , ' : ',  'Belajar itu menarik');
readln;
end.


Sekian dulu pembahasan mengenai perulangan for, semoga bermanfaat bagi kita semua...