YUDI IRAWAN YUDI IRAWAN YUDI IRAWAN SHARING: 11/08/11 >

Selasa, 08 November 2011

PENGGUNAAN FUNGSI STRING II

1.DESIGN PROGRAM











2.HASIL PROGRAM












3.LISTING PROGRAM
Public Class Form1

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


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim x, fx As Integer
        x = Val(txtx.Text)
        fx =x3 -x2 +3x +2
        Do While x > 0.0001
            fx =x3- x2+ 3x+2
            x = x + 0.0001
        Loop
        txthasil.Text = fx
    End Sub
    Private Sub bersih()
        txtx.Text = ""
        txthasil.Text = ""
        txtx.Focus()
    End Sub
    Private Sub cbohapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbohapus.Click
        Call bersih()
    End Sub

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


PENGGUNAAN FUNGSI STRING

1.DESIG FORM














2.HASIL PROGRAM UNTUK CBOTAHUN















3.HASIL PROGRAM UNTUK CBOJURUSAN















4.HASIL PROGRAM UNTUK CBONO















5.HASIL PROGRAM UNTUK CBONPM















6.HASIL KESELURUHAN PROGRAM

7.LISTING PROGRAM
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim t, s As Integer
        Dim j As String
        Dim k As String

        t = 2005
        Do While t <= 2011
            CBOtahun.Items.Add(t)
            t = t + 1
        Loop

        CBOJURUSAN.Items.Add("S1")
        CBOJURUSAN.Items.Add("D3")

        s = 100
        Do While s <= 250
            CBONO.Items.Add(s)
            s = s + 1
        Loop

    End Sub

    Private Sub no_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBONO.SelectedIndexChanged
        Dim a, b As String
        If CBOJURUSAN.Text = "S1" Then
            b = "11"
        Else
            b = "02"
        End If

        a = Microsoft.VisualBasic.Right(CBOtahun.Text, 2)
        CBONPM.Text = (a & b & CBONO.Text)
    End Sub

    Private Sub jurusan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBOJURUSAN.SelectedIndexChanged
        Dim a, b As String
        Dim c As Integer

        If CBOJURUSAN.Text = "S1" Then
            a = "11"
        Else
            a = "02"
        End If
        b = Microsoft.VisualBasic.Right(CBOtahun.Text, 2)
        c = 100
        Do While c <= 250
            CBONO.Items.Add(c)
            CBONPM.Items.Add(b & a & c)
            c = c + 1
        Loop
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMDHAPUS.Click
        CBOtahun.Text = ""
        CBOJURUSAN.Text = ""
        CBONO.Text = ""
        CBONPM.Text = ""
    End Sub

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