Jumat, 15 November 2019

Uas Visual Basic


1. Tujuan Dibuat Web Rabbani Cell ialah untuk mempermudah pelanggan dalam membeli sebuah item di toko rabbani cell. Web rabbani cell juga untuk membantu memper,udah rekan2 rabbani cell untuk menginput data supaya data stok toko terlihat jelas.
2.

3. Imports System.Data
Imports System.Data.OleDb
Imports System.Web
Imports Word = Microsoft.Office.Interop.Word
Imports Excel = Microsoft.Office.Interop.Excel
Public Class About
    Inherits Page
    Dim koneksi As String = “PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =D:/data/penjualan.mdb”
    Dim objekkoneksi As New OleDb.OleDbConnection(koneksi)
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnWord_Click(sender As Object, e As EventArgs) Handles btnWord.Click
        Dim Appnya As New Word.Application
        Dim Dokumennya As Word.Document
        Dokumennya = Appnya.Documents.Open(“D:\Data\penjualan.docx”)
        Dokumennya.Bookmarks(“namacustomer”).Select()
        Appnya.Selection.TypeText("Nama pembeli : " + txtNama.Text)
        Dokumennya.Bookmarks(“produk”).Select()
        Appnya.Selection.TypeText("Nama Barang : " + lsBarang.SelectedItem.Text)
        Dokumennya.Bookmarks(“harga”).Select()
        Appnya.Selection.TypeText("Harga Barang : " + txtHarga.Text)
        Dokumennya.Bookmarks(“jumlah”).Select()
        Appnya.Selection.TypeText("Jumlah Barang : " + txtJumlah.Text)
        Dokumennya.Bookmarks(“total”).Select()
        Appnya.Selection.TypeText("Total : " + txtTotal.Text)
        Dokumennya.SaveAs(“D:\Data\penjualan.docx”)
        MsgBox(“Data Berhasil Disimpan”)
        Appnya.Visible = True
    End Sub

    Protected Sub btnExcel_Click(sender As Object, e As EventArgs) Handles btnExcel.Click
        Dim AppExcelnya As New Excel.Application
        Dim ExcelWB As Excel.Workbook
        ExcelWB = AppExcelnya.Workbooks.Open(“D:\Data\penjualan.xlsx”)
        AppExcelnya.Range(“A2”).Value = txtNama.Text
        AppExcelnya.Range(“B2”).Value = lsBarang.Text
        AppExcelnya.Range(“C2”).Value = txtHarga.Text
        AppExcelnya.Range(“D2”).Value = txtJumlah.Text
        AppExcelnya.Range(“E2”).Value = txtTotal.Text
        ExcelWB.SaveAs(“D:\Data\penjualan.xlsx”)
        MsgBox(“Data Berhasil Disimpan”)
        AppExcelnya.Visible = True
    End Sub

    Protected Sub btnAccess_Click(sender As Object, e As EventArgs) Handles btnAccess.Click
        objekkoneksi.Close()
        Try
            objekkoneksi.Open()
            Dim tambah As String = ” INSERT INTO penjualan values ('" & txtNama.Text & "','" & lsBarang.SelectedItem.ToString() _
                & "','" & txtHarga.Text & "','" & txtJumlah.Text & "','" & txtTotal.Text & "') ”
            Dim oCmd = New OleDbCommand(tambah, objekkoneksi)
            oCmd.ExecuteNonQuery()
            objekkoneksi.Close()
            MsgBox(“Sukses”)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

End Class

5.



















Senin, 04 November 2019

UTS Visual Basic Web dengan MS. Word & Ms. Excel

1. Tujuan Dibuat Web Rabbani Cell ialah untuk mempermudah pelanggan dalam membeli sebuah item di toko rabbani cell. Web rabbani cell juga untuk membantu memper,udah rekan2 rabbani cell untuk menginput data supaya data stok toko terlihat jelas.

2.

3. Imports System.Data
Imports System.Data.OleDb
Imports System.Web
Imports Word = Microsoft.Office.Interop.Word
Imports Excel = Microsoft.Office.Interop.Excel
Public Class About
    Inherits Page
    Dim koneksi As String = “PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =D:/data/penjualan.mdb”
    Dim objekkoneksi As New OleDb.OleDbConnection(koneksi)
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnWord_Click(sender As Object, e As EventArgs) Handles btnWord.Click
        Dim Appnya As New Word.Application
        Dim Dokumennya As Word.Document
        Dokumennya = Appnya.Documents.Open(“D:\Data\penjualan.docx”)
        Dokumennya.Bookmarks(“namacustomer”).Select()
        Appnya.Selection.TypeText("Nama pembeli : " + txtNama.Text)
        Dokumennya.Bookmarks(“produk”).Select()
        Appnya.Selection.TypeText("Nama Barang : " + lsBarang.SelectedItem.Text)
        Dokumennya.Bookmarks(“harga”).Select()
        Appnya.Selection.TypeText("Harga Barang : " + txtHarga.Text)
        Dokumennya.Bookmarks(“jumlah”).Select()
        Appnya.Selection.TypeText("Jumlah Barang : " + txtJumlah.Text)
        Dokumennya.Bookmarks(“total”).Select()
        Appnya.Selection.TypeText("Total : " + txtTotal.Text)
        Dokumennya.SaveAs(“D:\Data\penjualan.docx”)
        MsgBox(“Data Berhasil Disimpan”)
        Appnya.Visible = True
    End Sub

    Protected Sub btnExcel_Click(sender As Object, e As EventArgs) Handles btnExcel.Click
        Dim AppExcelnya As New Excel.Application
        Dim ExcelWB As Excel.Workbook
        ExcelWB = AppExcelnya.Workbooks.Open(“D:\Data\penjualan.xlsx”)
        AppExcelnya.Range(“A2”).Value = txtNama.Text
        AppExcelnya.Range(“B2”).Value = lsBarang.Text
        AppExcelnya.Range(“C2”).Value = txtHarga.Text
        AppExcelnya.Range(“D2”).Value = txtJumlah.Text
        AppExcelnya.Range(“E2”).Value = txtTotal.Text
        ExcelWB.SaveAs(“D:\Data\penjualan.xlsx”)
        MsgBox(“Data Berhasil Disimpan”)
        AppExcelnya.Visible = True
    End Sub

    Protected Sub btnAccess_Click(sender As Object, e As EventArgs) Handles btnAccess.Click
        objekkoneksi.Close()
        Try
            objekkoneksi.Open()
            Dim tambah As String = ” INSERT INTO penjualan values ('" & txtNama.Text & "','" & lsBarang.SelectedItem.ToString() _
                & "','" & txtHarga.Text & "','" & txtJumlah.Text & "','" & txtTotal.Text & "') ”
            Dim oCmd = New OleDbCommand(tambah, objekkoneksi)
            oCmd.ExecuteNonQuery()
            objekkoneksi.Close()
            MsgBox(“Sukses”)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

End Class

5.

Export

Home Page
\








Senin, 15 Juli 2019

Mesin Moore Mod 5 dan Mod 6


MESIN MOORE

M={Q,å,d,S,D,l}
Q      : himpunan state
å      : himpunan input
d       : fungsi transisi
S       : symbol state awal
D       : himpunan output
l       : fungsi output untuk setiap state

MESIN MOORE MOD 5

M={Q,å,d,S,D,l}
Q      : {q0,q1.q2,q3,q4}
d
0
1
q0
q0
q1
q1
q2
q3
q2
q4
q0
q3
q1
q2
q4
q3
q4
å      : {1,0}
d       : fungsi transisi
S       : qo(0)
D       : {0,1,2,3,4}
l       : (qo=0|q1=1|q2=2|q3=3|q4=4)


Grapf mesin moore MOD 5


Pengujian :
21 mod 5 = 1 biner (10101)
29 mod 5 = 4 biner (11101)
22 mod 5 = 2 biner (10110)
26 mod 5 = 5 biner (11010)
31 mod 5 = 1 biner (11111)






MESIN MOORE MOD 6
d
0
1
q0
q0
q1
q1
q2
q3
q2
q4
q5
q3
q0
q1
q4
q2
q3
q5
 q4
q5 

M={Q,å,d,S,D,l}
Q      : { q0,q1,q2,q3,q4,q5}
å      : {01}
d       : fungsi transisi
S       : q0(0)
D       : {0,1,2,3,4,5}
l       : (qo=0|q1=1|q2=2|q3=3|q4=4|q5)




Pengujian :

10 mod 6 = 4 biner (1010)
24 mod 6 = 0 biner (11000)
28 mod 6 = 4 biner (11100)






Senin, 01 Juli 2019

Teori Bahasa dan Otomata


Finite State Automata memiliki state yang banyaknya tak terhingga dan dapat berpindah dari satu state ke state yang lain.
Finite State Automata dinyatakan oleh 5 tupel atau
M = ( Q , Σ , δ , S , F ) 
Q = Himpunan state
Σ = Himpunan symbol input
δ = Fungsi transisi
S = State awal
F = Himpunan state akhir

Contoh 





Deskripsi
M1 = ( Q , Σ , δ , S , F )
Q = { q0 , q1 , q2 , q3 , q4 }
Σ = { 0 , 1 }
S = { q0 }
F = { q4 }
δ =

Dilakukan Pengujian dengan Input:
1111      Accept
111001 Accept
11011  Accept
111     Accept
1101001 Accept


Grammer

Grammar adalah himpunan dari aturan-aturan yang terstruktur yang mengatur susunan kalimat, frase, dan kata dalam bahasa apapun

Tata Bahasa Grammar didefinisikan dalam 4 tupel D = ({ V,T,P,S })
V = Himpunan symbol variable
T = Himpunan symbol terminal
P = Kumpulan aturan produksi
S = Simbol awal





Pengujian Input
rssr =accept
rsrrsr=accept

a-> rB
B->rC
b->sE
C->sQ
D->rH
D->sG
H->sG-E->rD
E->sF
F->r
G->r

V={A,B,C,D,E,F,G,H,}
S={A}
T={r,s}