Minggu, 08 Juni 2014

Sistem Pendukung Keputusan - Weighted Product (WP) | Tumpal Manurung

Sebuah PTS di Kota Medan, akan memberikan beasiswa kepada 5 orang mahasiswanya. Adapun syarat pemberian beasiswa tersebut, yaitu harus memenuhi ketentuan berikut ini :

Syarat :
C1: Semester Aktif Perkuliahan (Attribut Keuntungan)
C2: IPK  (Attribut Keuntungan)
C3: Penghasilan Orang Tua  (Attribut Biaya)
C4: Aktif Berorganisasi (Attribut Keuntungan)

Untuk bobot W=[4,4,5,3]

Adapun mahasiswa yang menjadi alternatif dalam pemberian beasiswa yaitu :

No
Nama
C1
C2
C3
C4
1
Joko
VI
3.7
1.850.000
Aktif
2
Widodo
VI
3.5
1.500.000
Aktif
3
Simamora
IV
3.8
1.350.000
Tidak Aktif
4
Susilawati
II
3.9
1.650.000
Tidak Aktif
5
Dian
II
3.6
2.300.000
Aktif
6
Roma
IV
3.3
2.250.000
Aktif
7
Hendro
VIII
3.4
1.950.000
Aktif

Untuk pembobotan yang digunakan bisa mengacu pada bobot di bawah ini :
C1:Semester Aktif Perkuliahan
Semester II --> 1
Semester IV --> 2
 
Semester VI -->  3
Semester VIII -->  4

C2: IPK
 
IPK  3.00 - 3.249 --> 1
IPK  3.25 - 3.499 --> 2
IPK  3.50 - 3.749 --> 3
IPK  3.75 - 3.999 --> 4
IPK  4.00 --> 5
 
 
C3: Penghasilan Orang Tua 
 
1.000.000 --> 1
1.400.000 --> 2
1.800.000 --> 3
2.200.000 --> 4
2.600.000 --> 5
 

C4: Aktif Berorganisasi
Aktif --> 2
Tidak Aktif --> 1


Tabel Nilai Alternatif di Setiap Kriteria

No
Nama
C1
C2
C3
C4
1
Joko
VI
3.7
1.850.000
Aktif
2
Widodo
VI
3.5
1.500.000
Aktif
3
Simamora
IV
3.8
1.350.000
Tidak Aktif
4
Susilawati
II
3.9
1.650.000
Tidak Aktif
5
Dian
II
3.6
2.300.000
Aktif
6
Roma
IV
3.3
2.250.000
Aktif
7
Hendro
VIII
3.4
1.950.000
Aktif

Hasil Bobot dari nilai di atas

No
Nama
C1
C2
C3
C4
1
Joko
3
3
 3
 2
2
Widodo
3
3
 2
 2
3
Simamora
2
4
 1
 1
4
Susilawati
1
4
  2
 1
5
Dian
1
3
 4
 2
6
Roma
2
2
 4
 2
7
Hendro
4
2
 3
 2







Menghitung Vektor S :






S1 = (3 0.25 ) *( 3 0.25)*( 3 0.3125)*( 2 0.1875 ) = 2,7798
S2 = (3 0.25 ) *( 3 0.25)*( 2 0.3125)*( 2 0.1875 ) = 2,4489
S3 = (2 0.25 ) *( 4 0.25)*( 1 0.3125)*( 1 0.1875 ) = 1,6817
S4 = (1 0.25 ) *( 4 0.25)*( 2 0.3125)*( 1 0.1875 ) = 1,7561
S5 = (1 0.25 ) *( 3 0.25)*( 4 0.3125)*( 2 0.1875 ) = 2,3110
S6 = (2 0.25 ) *( 2 0.25)*( 4 0.3125)*( 2 0.1875 ) = 2,4834
S7 = (4 0.25 ) *( 2 0.25)*( 3 0.3125)*( 2 0.1875 ) = 2,6994


Menghitung Preferensi (V1) untuk Perangkingan :




Nilai Preferensi terbesar adalah V1 atau mahasiswa yang bernama Joko, yang sudah pasti mendapat beasiswa.

Minggu, 30 Juni 2013

TUGAS PEMBELAJARAN KRIPTOGRAFI

TAMPILAN FORM MENU TERLIHAT SEPERTI DIBAWAH INI :



  

Berikut Listing Programnya:


Public Class Form1

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

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

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

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


Berikut isi daripada menunya:
1.Caesar Chiper



 Listing programnya:

Public Class Form2

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        plaintext.Text = ""
        chipertext.Text = ""
    End Sub

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

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


2.Gronsfield Chiper



Berikut Listing Programnya :

Public Class Form3

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

    Private Sub Btnenkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnenkript.Click
        Dim J As Integer
        Dim Jum As Integer
        Dim sKey As String
        Dim nKata As Integer
        Dim nKunci As String
        Dim sKata As String
        Dim sPlain As String = ""
        Dim nEnc As Integer
        J = 0
        sKata = plaintext.Text
        Jum = Len(sKata)
        sKey = kunci.Text
        For i = 1 To Jum
            If J = Len(sKey) Then
                J = 1
            Else
                J = J + 1
            End If
            nKata = Asc(Mid(sKata, i, 1)) - 65
            nKunci = Asc(Mid(sKey, J, 1)) - 65
            nEnc = ((nKata + nKunci) Mod 26)
            sPlain = sPlain & Chr((nEnc))
        Next i
        chipertext.Text = sPlain
    End Sub

    Private Sub plaintext_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles plaintext.KeyPress
        e.KeyChar = UCase(e.KeyChar)
        Dim tombol As Integer = Asc(e.KeyChar)
        If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
            e.Handled = True
        End If
    End Sub

    Private Sub kunci_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles kunci.KeyPress
        e.KeyChar = UCase(e.KeyChar)
        Dim tombol As Integer = Asc(e.KeyChar)
        If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
            e.Handled = True
        End If
    End Sub

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





3.Vernam Chiper



Berikut Listing Programnya :

Public Class Form4


    Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        plaintext.Text = ""
        chipertext.Text = ""
        kunci.Text = ""
    End Sub

    Private Sub Btnenkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnenkript.Click
        Dim J As Integer
        Dim Jum As Integer
        Dim sKey As String
        Dim nKata As Integer
        Dim nKunci As Integer
        Dim sKata As String
        Dim sPlain As String = ""
        Dim nEnc As Integer
        J = 0
        sKata = plaintext.Text
        Jum = Len(sKata)
        sKey = kunci.Text
        For i = 1 To Jum
            If J = Len(sKey) Then
                J = 1
            Else
                J = J + 1
            End If
            nKata = Asc(Mid(sKata, i, 1)) - 65
            nKunci = Asc(Mid(sKey, J, 1)) - 65
            nEnc = ((nKata + nKunci) Mod 26)
            sPlain = sPlain & Chr((nEnc) + 65)
        Next i
        chipertext.Text = sPlain
    End Sub

    Private Sub plaintext_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles plaintext.KeyPress
        e.KeyChar = UCase(e.KeyChar)
        Dim tombol As Integer = Asc(e.KeyChar)
        If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
            e.Handled = True
        End If
    End Sub

    Private Sub kunci_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles kunci.KeyPress
        e.KeyChar = UCase(e.KeyChar)
        Dim tombol As Integer = Asc(e.KeyChar)
        If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
            e.Handled = True
        End If
    End Sub

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


4.Vigenere Chiper



Listing Programnya:

Public Class Form5

   
    Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        plaintext.Text = ""
        kunci.Text = ""
        chipertext.Text = ""
    End Sub

    Private Sub Btnenkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnenkript.Click
        Dim J As Integer
        Dim Jum As Integer
        Dim sKey As String
        Dim nKata As Integer
        Dim nKunci As Integer
        Dim sKata As String
        Dim sPlain As String = ""
        Dim nEnc As Integer
        J = 0
        sKata = plaintext.Text
        Jum = Len(sKata)
        sKey = kunci.Text
        For i = 1 To Jum
            If J = Len(sKey) Then
                J = 1
            Else
                J = J + 1
            End If
            nKata = Asc(Mid(sKata, i, 1)) + 0
            nKunci = Asc(Mid(sKey, J, 1)) + 0
            nEnc = ((nKata + nKunci) Mod 256)
            sPlain = sPlain & Chr((nEnc))
        Next i
        chipertext.Text = sPlain
    End Sub

    Private Sub plaintext_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles plaintext.KeyPress
        e.KeyChar = UCase(e.KeyChar)
        Dim tombol As Integer = Asc(e.KeyChar)
        If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
            e.Handled = True
        End If
    End Sub

    Private Sub kunci_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles kunci.KeyPress
        e.KeyChar = UCase(e.KeyChar)
        Dim tombol As Integer = Asc(e.KeyChar)
        If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
            e.Handled = True
        End If
    End Sub

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



5.Des Chiper


Listing Program:
Public Class Form6
Private Sub btnenkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnenkript.Click
Dim kunci As String, kunciChar As String, katabaru As String
Dim Pos As Integer
Dim i As Integer, Side1 As String, Side2 As String
Dim nEnc As Integer
Pos = 1
For i = 1 To Len(Plaintext.Text)
Plaintext.Text = Mid(Plaintext.Text, i, 1)
key.Text = Mid(key.Text, Pos, 1)
Chipertext.Text = Chipertext.Text & Chr(Asc(Of Char)() Xor Asc(key.Text))
If Pos = Len(kunci) Then Pos = 0
Pos = Pos + 1
Next i
If Len(Chipertext.Text) Mod 2 = 0 Then
Side1 = StrReverse(Left(Chipertext.Text, (Len(Chipertext.Text) / 2)))
Side2 = StrReverse(Right(Chipertext.Text, (Len(Chipertext.Text) / 2)))
Chipertext.Text = Side1 & Side2
End If
nEnc = Chipertext.Text
End Sub
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class

6.RC4


Listing Programnya :
Public Class Form7

    Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        plaintext.Text = ""
        kunci.Text = ""
        chipertext.Text = ""
    End Sub
    Private Function Rc4(ByVal message As String, ByVal password As String) As String
        Dim s = Enumerable.Range(0, 256).ToArray
        Dim i, j As Integer
        For i = 0 To s.Length - 1
            j = (j + Asc(password(i Mod password.Length)) + s(i)) And 255
            Dim temp = s(i)
            s(i) = s(j)
            s(j) = temp
        Next
        i = 0
        j = 0
        Dim sb As New System.Text.StringBuilder(message.Length)
        For Each c As Char In message
            i = (i + 1) And 255
            j = (j + s(i)) And 255
            Dim temp = s(i)
            s(i) = s(j)
            s(j) = temp
            sb.Append(Chr(s((s(i) + s(j)) And 255) Xor Asc(c)))
        Next
        Return sb.ToString
    End Function

    Private Sub Btnenkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnenkript.Click
        chipertext.Text = Rc4(plaintext.Text, kunci.Text)
    End Sub

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


ingin lebih jago lagi ??
Lanjut di Mesran,blogspot.com :) :D