SlideShare a Scribd company logo
MAKALAH PEMROGRAMAN KOMPUTER 1


Disusun untuk memenuhi tugas Ujian Tengah Semester
        Mata Kuliah Pemrogaman Komputer 1


                Dosen Pengampu:
               Wildan Suharso. S.Si




                      Oleh :

          Muhammad Sukron       10610067




         JURUSAN MATEMATIKA
     FAKULTAS SAINS DAN TEKNOLOGI
UNIVERSITAS ISLAM NEGERI MAULANA MALIK
            IBRAHIM MALANG
                  2012
BAB I

                          FLOWCHART

1.1 Irisan, Gabungan dan Komplemen



                              Start




       dipilih() as char
       nilai, nilai2 as integer
       f, g,h as string
       A()as string = a.Split(pecah)
       B()as string = b.Split(pecah)
       S()as string = s.Split(pecah)


               f = TextBox1.Text
               g = TextBox2.Text
               h = TextBox3.Text



                 For i = 0 To Ubound(A)




                    For j = 0 To       Ubound(B)




                           If A (i)= B (j)




 B                                 A               C
B                  A              C



          ListBox1.Items.Add(A (i))




         for i=0 to Ubound (A)




          ListBox2.Items.Add(A(i))




        for j = 0 to Ubound (B)




        for k = 0 to Ubound (A)




                If B(j) < > A(k)




E                      D              F
E                D                   F


          nilai = nilai + 1




       If nilai > A.Length - 1




     ListBox2.Items.Add(B(j))




              nilai = 0



    for i = 0 to Ubound (S)




    for j = 0 to Ubound (A)




I                H               J
I              H               J


    If S(i) <> A(j)




         Nilai2 += 1




        If x > A.Length -
    1




    ListBox3.Items.Add(S(i))




            Nilai2 = 0




               Stop
1.2 Selection Sort irisan A dan B




                                        Start




                    i, r , q, m, n As Integer
                    r = ListBox1.Items.Count - 1
                    selec_irisan(r) As Integer


                                  For i = 0 To r



                    Selec_irisan(i) = ListBox1.Items(i)



                               For i = 0 To
                               selec_irisan. length
                               1

                                        m = i


                           For q = i + 1 To
                           selec_irisan.Length- 1



M                                         K               N
M                      K                N




             If selec_ irisan (q) <
             selec_irisan(m)




                     m=q



                     If m <> i



    n = selec_irisan (i)
    selec_irisan(i) = selec_irisan(m)
    selec_irisan(m) = n


           For p = 0 To
           selec_irisan.Length - 1




         TextBox4.AppendText(CStr(se
         lec_irisan(p)) & " ")




                      Stop
1.3 Selection Sort Gabungan A dan B


                                     Start




                     min, temp, y As Integer
                     y = ListBox2.Items.Count - 1
                     gabunganAB(x) As Integer


                                  For i = 0 To y



                     Selec_gabungan (i) = ListBox2.Items(i)



                              For i = 0 To
                              Selc_gabungn.Length-1



                                      min = i


                           For j = i + 1 To
                           Selec_gabungan.Length - 1



P                                      O                      Q
P                    O                       Q




            If Selec_gabungan (j)
            < Selec_gabungan
            (min)


                   min = j



                  If min <> i



    temp = Selec_gabungan (i)
    Selec_gabungan (i) = Selec_gabungan(m)
    Selec_gabungan (min) = temp


          For p= 0 To
          Selec_gabungan.Length
          -1


        TextBox4.AppendText(CStr(ga
        Selec_gabungan (p)) & " ")




                    Stop
1.4 Selection Sort komplemen A terhadap S




                                    Start




                    km, kp, z As Integer
                    z = ListBox3.Items.Count - 1
                    selec_komplemn(z) As Integer


                                 For i = 0 To z



                    selec_komplemn (i) = ListBox3.Items(i)



                             For i = 0 To
                             selc_komplmn.Length-1



                                     km = i


                          For j = i + 1 To
                          selec_komplemn.Length - 1



 S                                    R                      T
P                    O                      Q




            If selec_komplemn (j)
            < selc_komplmn (km)




                   km = j



                  If km < > i



    kp = selec_komplemn (i)
    selec_komplmn (i) = selc_komplmn (km)
    selec_komplemn (km) = kp


          For p= 0 To
          selec_komplemn.Length
          -1


        TextBox4.AppendText(CStr(k
        selec_komplemn (p)) & " ")




                    Stop
BAB II

                            PESEUDOCODE



2.1 Irisan

  For i = 0 to Ubound[A] {

      For j = 0 to Ubound[B]

           If A[i]=B[j]

       }

  }

2.2 Gabungan

For i = 0 to Ubound[B] {

   For j = 0 to Ubound[A]

           If B[i]< >A[j]

               Nilai = nilai + 1

           If nilai > A.length – 1

               Nilai = 0

       }

  }



2.3 Komplemen

For i = 0 to Ubound[S] {
For j = 0 to Ubound[A]

           If S[i]< >A[j]

               Nilai2 + = 1

           If nilai2 > A.length – 1

               Nilai2 = 0

       }

   }



2.4 Selection Irisan

   For i = 0 to selec_irisan.length – 1{

           m=i

           for q = i + 1 to selec_irisan.length – 1

               if selec_irisan [q] < selec_irisan [m]

                    m=0

               if m < > i

                    n= selec_irisan [i]

                    selec_irisan [i] = selec_irisan [m]

                    selec_irisan [m] = n

       }

   }
2.5 Selection Gabungan

   For i = 0 to selec_gabungan.length – 1{

           min = i

           for j = i + 1 to selec_gabunga.length – 1

               if selec_gabungan [j] < selec_gabungan [min]

                     min = j

               if min < > i

                     temp = selec_gabungan [i]

                     selec_ gabungan [i] = selec_gabungan [min]

                     selec_ gabungan [min] = temp

       }

   }




2.6 Selection Komplemen

   For i = 0 to selec_komplemen.length – 1{

           km = i

           for j = i + 1 to selec_komplemen.length – 1

               if selec_komplemen [j] < selec_komplemen [km]

                     km = j
if km < > i

            kp = selec_komplemen [i]

            selec_komplemen [i] = selec_komplemen [km]

            selec_komplemen [km] = kp

    }

}
BAB III

TAMPILAN APLIKASI
BAB IV

                        SOURCE
Public Class Form1

    Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
        Dim dipilih() As Char = {".", ",", "*", " "}
        Dim f, g, h As String
        Dim nilai, nilai2 As Integer
        nilai = 0
        nilai2 = 0
        f = TextBox1.Text
        g = TextBox2.Text
        h = TextBox3.Text

       Dim A() As String = f.Split(dipilih)
       Dim B() As String = g.Split(dipilih)
       Dim S() As String = h.Split(dipilih)

       'irisan
       For i = 0 To UBound(A)
            For j = 0 To UBound(B)
                If A(i) = B(j) Then
                    ListBox1.Items.Add(A(i))
                End If
            Next
       Next

       'gabungan
       For i = 0 To UBound(A)
            ListBox2.Items.Add(A(i))
       Next

       For i = 0 To UBound(B)
            For j = 0 To UBound(A)
                If B(i) <> A(j) Then
                    nilai = nilai + 1
                End If
            Next
            If nilai > A.Length - 1 Then
                ListBox2.Items.Add(B(i))
            End If
            nilai = 0
       Next
       'komplemen
For i = 0 To UBound(S)
             For j = 0 To UBound(A)
                 If S(i) <> A(j) Then
                     nilai2 += 1
                 End If
             Next
             If nilai2 > A.Length - 1 Then
                 ListBox3.Items.Add(S(i))
             End If
             nilai2 = 0
        Next

    End Sub


    Private Sub Label13_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Label13.Click
        Refresh()
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        ListBox1.Text = ""
        ListBox2.Text = ""
        ListBox3.Text = ""
    End Sub

    Private Sub Label15_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Label15.Click
        MsgBox("muhammad sukron" + vbCrLf + "10610067")
    End Sub

    Private Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
        'sort irirsan
        Dim i, r, q, m, n As Integer
        r = ListBox1.Items.Count - 1
        Dim selec_irisan(r) As Integer
        For i = 0 To r
             selec_irisan(i) = ListBox1.Items(i)
        Next
        For i = 0 To selec_irisan.Length - 1
             m = i
             For q = i + 1 To selec_irisan.Length - 1
If selec_irisan(q) < selec_irisan(m) Then
                       m = q
                   End If
               Next
               If m <> i Then
                   n = selec_irisan(i)
                   selec_irisan(i) = selec_irisan(m)
                   selec_irisan(m) = n
               End If
        Next

        For p = 0 To selec_irisan.Length - 1
            TextBox4.AppendText(" " +
CStr(selec_irisan(p)))

        Next
        'sort gabungan
        Dim min, temp, y As Integer
        y = ListBox2.Items.Count - 1
        Dim selec_gabungan(y) As Integer
        For i = 0 To y
             selec_gabungan(i) = ListBox2.Items(i)
        Next
        For i = 0 To selec_gabungan.Length - 1
             min = i
             For j = i + 1 To selec_gabungan.Length - 1
                 If selec_gabungan(j) <
selec_gabungan(min) Then
                     min = j
                 End If
             Next
             If min <> i Then
                 temp = selec_gabungan(i)
                 selec_gabungan(i) = selec_gabungan(min)
                 selec_gabungan(min) = temp
             End If
        Next
        For p = 0 To selec_gabungan.Length - 1
             TextBox5.AppendText(" " +
CStr(selec_gabungan(p)))
        Next



        'sort komplemen

        Dim km, kp, z As Integer
        z = ListBox3.Items.Count - 1
        Dim selec_komplemen(z) As Integer
For i = 0 To z
             selec_komplemen(i) = ListBox3.Items(i)
        Next
        For i = 0 To selec_komplemen.Length - 1
             km = i
             For j = i + 1 To selec_komplemen.Length - 1
                 If selec_komplemen(j) <
selec_komplemen(km) Then
                     km = j
                 End If
             Next

               If km <> i Then
                   kp = selec_komplemen(i)
                   selec_komplemen(i) = selec_komplemen(km)
                   selec_komplemen(km) = kp
               End If
        Next

        For p = 0 To selec_komplemen.Length - 1
             TextBox6.AppendText(" " +
CStr(selec_komplemen(p)))
        Next
    End Sub
End Class

More Related Content

What's hot

Ols
OlsOls
On best one sided approximation by multivariate lagrange
      On best one sided approximation by multivariate lagrange      On best one sided approximation by multivariate lagrange
On best one sided approximation by multivariate lagrange
Alexander Decker
 
Applications of Homotopy perturbation Method and Sumudu Transform for Solving...
Applications of Homotopy perturbation Method and Sumudu Transform for Solving...Applications of Homotopy perturbation Method and Sumudu Transform for Solving...
Applications of Homotopy perturbation Method and Sumudu Transform for Solving...
IJRES Journal
 
2017-12, Keio University, Projection-based Regularized Dual Averaging for Sto...
2017-12, Keio University, Projection-based Regularized Dual Averaging for Sto...2017-12, Keio University, Projection-based Regularized Dual Averaging for Sto...
2017-12, Keio University, Projection-based Regularized Dual Averaging for Sto...
asahiushio1
 
PMED Transition Workshop - A Bayesian Model for Joint Longitudinal and Surviv...
PMED Transition Workshop - A Bayesian Model for Joint Longitudinal and Surviv...PMED Transition Workshop - A Bayesian Model for Joint Longitudinal and Surviv...
PMED Transition Workshop - A Bayesian Model for Joint Longitudinal and Surviv...
The Statistical and Applied Mathematical Sciences Institute
 
International journal of engineering and mathematical modelling vol2 no3_2015_2
International journal of engineering and mathematical modelling vol2 no3_2015_2International journal of engineering and mathematical modelling vol2 no3_2015_2
International journal of engineering and mathematical modelling vol2 no3_2015_2
IJEMM
 
2017-03, ICASSP, Projection-based Dual Averaging for Stochastic Sparse Optimi...
2017-03, ICASSP, Projection-based Dual Averaging for Stochastic Sparse Optimi...2017-03, ICASSP, Projection-based Dual Averaging for Stochastic Sparse Optimi...
2017-03, ICASSP, Projection-based Dual Averaging for Stochastic Sparse Optimi...
asahiushio1
 
Paper Introduction: Combinatorial Model and Bounds for Target Set Selection
Paper Introduction: Combinatorial Model and Bounds for Target Set SelectionPaper Introduction: Combinatorial Model and Bounds for Target Set Selection
Paper Introduction: Combinatorial Model and Bounds for Target Set Selection
Yu Liu
 
2017-07, Research Seminar at Keio University, Metric Perspective of Stochasti...
2017-07, Research Seminar at Keio University, Metric Perspective of Stochasti...2017-07, Research Seminar at Keio University, Metric Perspective of Stochasti...
2017-07, Research Seminar at Keio University, Metric Perspective of Stochasti...
asahiushio1
 
Some New Operations on Fuzzy Soft Sets
Some New Operations on Fuzzy Soft SetsSome New Operations on Fuzzy Soft Sets
Some New Operations on Fuzzy Soft Sets
IJMER
 
Fixed point result in probabilistic metric space
Fixed point result in probabilistic metric spaceFixed point result in probabilistic metric space
Fixed point result in probabilistic metric space
Alexander Decker
 
Errors in the Discretized Solution of a Differential Equation
Errors in the Discretized Solution of a Differential EquationErrors in the Discretized Solution of a Differential Equation
Errors in the Discretized Solution of a Differential Equation
ijtsrd
 
A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...
Alexander Decker
 
EXACT SOLUTIONS OF A FAMILY OF HIGHER-DIMENSIONAL SPACE-TIME FRACTIONAL KDV-T...
EXACT SOLUTIONS OF A FAMILY OF HIGHER-DIMENSIONAL SPACE-TIME FRACTIONAL KDV-T...EXACT SOLUTIONS OF A FAMILY OF HIGHER-DIMENSIONAL SPACE-TIME FRACTIONAL KDV-T...
EXACT SOLUTIONS OF A FAMILY OF HIGHER-DIMENSIONAL SPACE-TIME FRACTIONAL KDV-T...
cscpconf
 
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTIONA COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
ijsc
 
On the Application of a Classical Fixed Point Method in the Optimization of a...
On the Application of a Classical Fixed Point Method in the Optimization of a...On the Application of a Classical Fixed Point Method in the Optimization of a...
On the Application of a Classical Fixed Point Method in the Optimization of a...
BRNSS Publication Hub
 
A new approach to constants of the motion and the helmholtz conditions
A new approach to constants of the motion and the helmholtz conditionsA new approach to constants of the motion and the helmholtz conditions
A new approach to constants of the motion and the helmholtz conditions
Alexander Decker
 
Wasserstein GAN
Wasserstein GANWasserstein GAN
Wasserstein GAN
Jinho Lee
 

What's hot (18)

Ols
OlsOls
Ols
 
On best one sided approximation by multivariate lagrange
      On best one sided approximation by multivariate lagrange      On best one sided approximation by multivariate lagrange
On best one sided approximation by multivariate lagrange
 
Applications of Homotopy perturbation Method and Sumudu Transform for Solving...
Applications of Homotopy perturbation Method and Sumudu Transform for Solving...Applications of Homotopy perturbation Method and Sumudu Transform for Solving...
Applications of Homotopy perturbation Method and Sumudu Transform for Solving...
 
2017-12, Keio University, Projection-based Regularized Dual Averaging for Sto...
2017-12, Keio University, Projection-based Regularized Dual Averaging for Sto...2017-12, Keio University, Projection-based Regularized Dual Averaging for Sto...
2017-12, Keio University, Projection-based Regularized Dual Averaging for Sto...
 
PMED Transition Workshop - A Bayesian Model for Joint Longitudinal and Surviv...
PMED Transition Workshop - A Bayesian Model for Joint Longitudinal and Surviv...PMED Transition Workshop - A Bayesian Model for Joint Longitudinal and Surviv...
PMED Transition Workshop - A Bayesian Model for Joint Longitudinal and Surviv...
 
International journal of engineering and mathematical modelling vol2 no3_2015_2
International journal of engineering and mathematical modelling vol2 no3_2015_2International journal of engineering and mathematical modelling vol2 no3_2015_2
International journal of engineering and mathematical modelling vol2 no3_2015_2
 
2017-03, ICASSP, Projection-based Dual Averaging for Stochastic Sparse Optimi...
2017-03, ICASSP, Projection-based Dual Averaging for Stochastic Sparse Optimi...2017-03, ICASSP, Projection-based Dual Averaging for Stochastic Sparse Optimi...
2017-03, ICASSP, Projection-based Dual Averaging for Stochastic Sparse Optimi...
 
Paper Introduction: Combinatorial Model and Bounds for Target Set Selection
Paper Introduction: Combinatorial Model and Bounds for Target Set SelectionPaper Introduction: Combinatorial Model and Bounds for Target Set Selection
Paper Introduction: Combinatorial Model and Bounds for Target Set Selection
 
2017-07, Research Seminar at Keio University, Metric Perspective of Stochasti...
2017-07, Research Seminar at Keio University, Metric Perspective of Stochasti...2017-07, Research Seminar at Keio University, Metric Perspective of Stochasti...
2017-07, Research Seminar at Keio University, Metric Perspective of Stochasti...
 
Some New Operations on Fuzzy Soft Sets
Some New Operations on Fuzzy Soft SetsSome New Operations on Fuzzy Soft Sets
Some New Operations on Fuzzy Soft Sets
 
Fixed point result in probabilistic metric space
Fixed point result in probabilistic metric spaceFixed point result in probabilistic metric space
Fixed point result in probabilistic metric space
 
Errors in the Discretized Solution of a Differential Equation
Errors in the Discretized Solution of a Differential EquationErrors in the Discretized Solution of a Differential Equation
Errors in the Discretized Solution of a Differential Equation
 
A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...
 
EXACT SOLUTIONS OF A FAMILY OF HIGHER-DIMENSIONAL SPACE-TIME FRACTIONAL KDV-T...
EXACT SOLUTIONS OF A FAMILY OF HIGHER-DIMENSIONAL SPACE-TIME FRACTIONAL KDV-T...EXACT SOLUTIONS OF A FAMILY OF HIGHER-DIMENSIONAL SPACE-TIME FRACTIONAL KDV-T...
EXACT SOLUTIONS OF A FAMILY OF HIGHER-DIMENSIONAL SPACE-TIME FRACTIONAL KDV-T...
 
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTIONA COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
 
On the Application of a Classical Fixed Point Method in the Optimization of a...
On the Application of a Classical Fixed Point Method in the Optimization of a...On the Application of a Classical Fixed Point Method in the Optimization of a...
On the Application of a Classical Fixed Point Method in the Optimization of a...
 
A new approach to constants of the motion and the helmholtz conditions
A new approach to constants of the motion and the helmholtz conditionsA new approach to constants of the motion and the helmholtz conditions
A new approach to constants of the motion and the helmholtz conditions
 
Wasserstein GAN
Wasserstein GANWasserstein GAN
Wasserstein GAN
 

Similar to Makalah pk

chap09alg.ppt for string matching algorithm
chap09alg.ppt for string matching algorithmchap09alg.ppt for string matching algorithm
chap09alg.ppt for string matching algorithm
SadiaSharmin40
 
Poggi analytics - distance - 1a
Poggi   analytics - distance - 1aPoggi   analytics - distance - 1a
Poggi analytics - distance - 1a
Gaston Liberman
 
Dynamic programming - fundamentals review
Dynamic programming - fundamentals reviewDynamic programming - fundamentals review
Dynamic programming - fundamentals review
ElifTech
 
Imc2017 day2-solutions
Imc2017 day2-solutionsImc2017 day2-solutions
Imc2017 day2-solutions
Christos Loizos
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
Dr. C.V. Suresh Babu
 
List comprehensions
List comprehensionsList comprehensions
List comprehensions
Jordi Gómez
 
Fixed Point Theorem in Fuzzy Metric Space Using (CLRg) Property
Fixed Point Theorem in Fuzzy Metric Space Using (CLRg) PropertyFixed Point Theorem in Fuzzy Metric Space Using (CLRg) Property
Fixed Point Theorem in Fuzzy Metric Space Using (CLRg) Property
inventionjournals
 
Array
ArrayArray
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexity
showkat27
 
Ch3(1).pptxbbbbbbbbbbbbbbbbbbbhhhhhhhhhh
Ch3(1).pptxbbbbbbbbbbbbbbbbbbbhhhhhhhhhhCh3(1).pptxbbbbbbbbbbbbbbbbbbbhhhhhhhhhh
Ch3(1).pptxbbbbbbbbbbbbbbbbbbbhhhhhhhhhh
danielgetachew0922
 
Kotlin for Android Developers - 2
Kotlin for Android Developers - 2Kotlin for Android Developers - 2
Kotlin for Android Developers - 2
Mohamed Nabil, MSc.
 
Closeszdfgjklfghjt.string
Closeszdfgjklfghjt.stringCloseszdfgjklfghjt.string
Closeszdfgjklfghjt.string
Phúc Thành
 
Array
ArrayArray
String searching
String searching String searching
String searching
thinkphp
 
ch3.ppt
ch3.pptch3.ppt

Similar to Makalah pk (20)

Chap09alg
Chap09algChap09alg
Chap09alg
 
Chap09alg
Chap09algChap09alg
Chap09alg
 
1D Array
1D Array1D Array
1D Array
 
chap09alg.ppt for string matching algorithm
chap09alg.ppt for string matching algorithmchap09alg.ppt for string matching algorithm
chap09alg.ppt for string matching algorithm
 
Poggi analytics - distance - 1a
Poggi   analytics - distance - 1aPoggi   analytics - distance - 1a
Poggi analytics - distance - 1a
 
Dynamic programming - fundamentals review
Dynamic programming - fundamentals reviewDynamic programming - fundamentals review
Dynamic programming - fundamentals review
 
U0 vqmtq3mja=
U0 vqmtq3mja=U0 vqmtq3mja=
U0 vqmtq3mja=
 
Imc2017 day2-solutions
Imc2017 day2-solutionsImc2017 day2-solutions
Imc2017 day2-solutions
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
List comprehensions
List comprehensionsList comprehensions
List comprehensions
 
Fixed Point Theorem in Fuzzy Metric Space Using (CLRg) Property
Fixed Point Theorem in Fuzzy Metric Space Using (CLRg) PropertyFixed Point Theorem in Fuzzy Metric Space Using (CLRg) Property
Fixed Point Theorem in Fuzzy Metric Space Using (CLRg) Property
 
Array
ArrayArray
Array
 
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexity
 
Ch3(1).pptxbbbbbbbbbbbbbbbbbbbhhhhhhhhhh
Ch3(1).pptxbbbbbbbbbbbbbbbbbbbhhhhhhhhhhCh3(1).pptxbbbbbbbbbbbbbbbbbbbhhhhhhhhhh
Ch3(1).pptxbbbbbbbbbbbbbbbbbbbhhhhhhhhhh
 
Kotlin for Android Developers - 2
Kotlin for Android Developers - 2Kotlin for Android Developers - 2
Kotlin for Android Developers - 2
 
Closeszdfgjklfghjt.string
Closeszdfgjklfghjt.stringCloseszdfgjklfghjt.string
Closeszdfgjklfghjt.string
 
Array
ArrayArray
Array
 
String searching
String searching String searching
String searching
 
ch3.ppt
ch3.pptch3.ppt
ch3.ppt
 
Lec2 slides
Lec2 slidesLec2 slides
Lec2 slides
 

Recently uploaded

I Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledgeI Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledge
Sabrina Ricci
 
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardom
Young Tom Selleck: A Journey Through His Early Years and Rise to StardomYoung Tom Selleck: A Journey Through His Early Years and Rise to Stardom
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardom
greendigital
 
240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf
Madhura TBRC
 
This Is The First All Category Quiz That I Made
This Is The First All Category Quiz That I MadeThis Is The First All Category Quiz That I Made
This Is The First All Category Quiz That I Made
Aarush Ghate
 
DIGIDEVTV A New area of OTT Distribution
DIGIDEVTV  A New area of OTT DistributionDIGIDEVTV  A New area of OTT Distribution
DIGIDEVTV A New area of OTT Distribution
joeqsm
 
Tom Selleck Net Worth: A Comprehensive Analysis
Tom Selleck Net Worth: A Comprehensive AnalysisTom Selleck Net Worth: A Comprehensive Analysis
Tom Selleck Net Worth: A Comprehensive Analysis
greendigital
 
Hollywood Actress - The 250 hottest gallery
Hollywood Actress - The 250 hottest galleryHollywood Actress - The 250 hottest gallery
Hollywood Actress - The 250 hottest gallery
Zsolt Nemeth
 
Snoopy boards the big bow wow musical __
Snoopy boards the big bow wow musical __Snoopy boards the big bow wow musical __
Snoopy boards the big bow wow musical __
catcabrera
 
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
9u08k0x
 
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
Mega P
 
Christina's Baby Shower Game June 2024.pptx
Christina's Baby Shower Game June 2024.pptxChristina's Baby Shower Game June 2024.pptx
Christina's Baby Shower Game June 2024.pptx
madeline604788
 
Treasure Hunt Puzzles, Treasure Hunt Puzzles online
Treasure Hunt Puzzles, Treasure Hunt Puzzles onlineTreasure Hunt Puzzles, Treasure Hunt Puzzles online
Treasure Hunt Puzzles, Treasure Hunt Puzzles online
Hidden Treasure Hunts
 
哪里买(osu毕业证书)美国俄勒冈州立大学毕业证双学位证书原版一模一样
哪里买(osu毕业证书)美国俄勒冈州立大学毕业证双学位证书原版一模一样哪里买(osu毕业证书)美国俄勒冈州立大学毕业证双学位证书原版一模一样
哪里买(osu毕业证书)美国俄勒冈州立大学毕业证双学位证书原版一模一样
9u08k0x
 
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docxThe Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
Xtreame HDTV
 
Matt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdf
Matt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdfMatt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdf
Matt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdf
Azura Everhart
 
Scandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.zaScandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.za
Isaac More
 
A TO Z INDIA Monthly Magazine - JUNE 2024
A TO Z INDIA Monthly Magazine - JUNE 2024A TO Z INDIA Monthly Magazine - JUNE 2024
A TO Z INDIA Monthly Magazine - JUNE 2024
Indira Srivatsa
 
Skeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on ForumSkeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on Forum
Isaac More
 
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and LoveMeet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
get joys
 
Emcee Profile_ Subbu from Bangalore .pdf
Emcee Profile_ Subbu from Bangalore .pdfEmcee Profile_ Subbu from Bangalore .pdf
Emcee Profile_ Subbu from Bangalore .pdf
subran
 

Recently uploaded (20)

I Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledgeI Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledge
 
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardom
Young Tom Selleck: A Journey Through His Early Years and Rise to StardomYoung Tom Selleck: A Journey Through His Early Years and Rise to Stardom
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardom
 
240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf
 
This Is The First All Category Quiz That I Made
This Is The First All Category Quiz That I MadeThis Is The First All Category Quiz That I Made
This Is The First All Category Quiz That I Made
 
DIGIDEVTV A New area of OTT Distribution
DIGIDEVTV  A New area of OTT DistributionDIGIDEVTV  A New area of OTT Distribution
DIGIDEVTV A New area of OTT Distribution
 
Tom Selleck Net Worth: A Comprehensive Analysis
Tom Selleck Net Worth: A Comprehensive AnalysisTom Selleck Net Worth: A Comprehensive Analysis
Tom Selleck Net Worth: A Comprehensive Analysis
 
Hollywood Actress - The 250 hottest gallery
Hollywood Actress - The 250 hottest galleryHollywood Actress - The 250 hottest gallery
Hollywood Actress - The 250 hottest gallery
 
Snoopy boards the big bow wow musical __
Snoopy boards the big bow wow musical __Snoopy boards the big bow wow musical __
Snoopy boards the big bow wow musical __
 
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
 
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
 
Christina's Baby Shower Game June 2024.pptx
Christina's Baby Shower Game June 2024.pptxChristina's Baby Shower Game June 2024.pptx
Christina's Baby Shower Game June 2024.pptx
 
Treasure Hunt Puzzles, Treasure Hunt Puzzles online
Treasure Hunt Puzzles, Treasure Hunt Puzzles onlineTreasure Hunt Puzzles, Treasure Hunt Puzzles online
Treasure Hunt Puzzles, Treasure Hunt Puzzles online
 
哪里买(osu毕业证书)美国俄勒冈州立大学毕业证双学位证书原版一模一样
哪里买(osu毕业证书)美国俄勒冈州立大学毕业证双学位证书原版一模一样哪里买(osu毕业证书)美国俄勒冈州立大学毕业证双学位证书原版一模一样
哪里买(osu毕业证书)美国俄勒冈州立大学毕业证双学位证书原版一模一样
 
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docxThe Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
 
Matt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdf
Matt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdfMatt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdf
Matt Rife Cancels Shows Due to Health Concerns, Reschedules Tour Dates.pdf
 
Scandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.zaScandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.za
 
A TO Z INDIA Monthly Magazine - JUNE 2024
A TO Z INDIA Monthly Magazine - JUNE 2024A TO Z INDIA Monthly Magazine - JUNE 2024
A TO Z INDIA Monthly Magazine - JUNE 2024
 
Skeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on ForumSkeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on Forum
 
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and LoveMeet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
 
Emcee Profile_ Subbu from Bangalore .pdf
Emcee Profile_ Subbu from Bangalore .pdfEmcee Profile_ Subbu from Bangalore .pdf
Emcee Profile_ Subbu from Bangalore .pdf
 

Makalah pk

  • 1. MAKALAH PEMROGRAMAN KOMPUTER 1 Disusun untuk memenuhi tugas Ujian Tengah Semester Mata Kuliah Pemrogaman Komputer 1 Dosen Pengampu: Wildan Suharso. S.Si Oleh : Muhammad Sukron 10610067 JURUSAN MATEMATIKA FAKULTAS SAINS DAN TEKNOLOGI UNIVERSITAS ISLAM NEGERI MAULANA MALIK IBRAHIM MALANG 2012
  • 2. BAB I FLOWCHART 1.1 Irisan, Gabungan dan Komplemen Start dipilih() as char nilai, nilai2 as integer f, g,h as string A()as string = a.Split(pecah) B()as string = b.Split(pecah) S()as string = s.Split(pecah) f = TextBox1.Text g = TextBox2.Text h = TextBox3.Text For i = 0 To Ubound(A) For j = 0 To Ubound(B) If A (i)= B (j) B A C
  • 3. B A C ListBox1.Items.Add(A (i)) for i=0 to Ubound (A) ListBox2.Items.Add(A(i)) for j = 0 to Ubound (B) for k = 0 to Ubound (A) If B(j) < > A(k) E D F
  • 4. E D F nilai = nilai + 1 If nilai > A.Length - 1 ListBox2.Items.Add(B(j)) nilai = 0 for i = 0 to Ubound (S) for j = 0 to Ubound (A) I H J
  • 5. I H J If S(i) <> A(j) Nilai2 += 1 If x > A.Length - 1 ListBox3.Items.Add(S(i)) Nilai2 = 0 Stop
  • 6. 1.2 Selection Sort irisan A dan B Start i, r , q, m, n As Integer r = ListBox1.Items.Count - 1 selec_irisan(r) As Integer For i = 0 To r Selec_irisan(i) = ListBox1.Items(i) For i = 0 To selec_irisan. length 1 m = i For q = i + 1 To selec_irisan.Length- 1 M K N
  • 7. M K N If selec_ irisan (q) < selec_irisan(m) m=q If m <> i n = selec_irisan (i) selec_irisan(i) = selec_irisan(m) selec_irisan(m) = n For p = 0 To selec_irisan.Length - 1 TextBox4.AppendText(CStr(se lec_irisan(p)) & " ") Stop
  • 8. 1.3 Selection Sort Gabungan A dan B Start min, temp, y As Integer y = ListBox2.Items.Count - 1 gabunganAB(x) As Integer For i = 0 To y Selec_gabungan (i) = ListBox2.Items(i) For i = 0 To Selc_gabungn.Length-1 min = i For j = i + 1 To Selec_gabungan.Length - 1 P O Q
  • 9. P O Q If Selec_gabungan (j) < Selec_gabungan (min) min = j If min <> i temp = Selec_gabungan (i) Selec_gabungan (i) = Selec_gabungan(m) Selec_gabungan (min) = temp For p= 0 To Selec_gabungan.Length -1 TextBox4.AppendText(CStr(ga Selec_gabungan (p)) & " ") Stop
  • 10. 1.4 Selection Sort komplemen A terhadap S Start km, kp, z As Integer z = ListBox3.Items.Count - 1 selec_komplemn(z) As Integer For i = 0 To z selec_komplemn (i) = ListBox3.Items(i) For i = 0 To selc_komplmn.Length-1 km = i For j = i + 1 To selec_komplemn.Length - 1 S R T
  • 11. P O Q If selec_komplemn (j) < selc_komplmn (km) km = j If km < > i kp = selec_komplemn (i) selec_komplmn (i) = selc_komplmn (km) selec_komplemn (km) = kp For p= 0 To selec_komplemn.Length -1 TextBox4.AppendText(CStr(k selec_komplemn (p)) & " ") Stop
  • 12. BAB II PESEUDOCODE 2.1 Irisan For i = 0 to Ubound[A] { For j = 0 to Ubound[B] If A[i]=B[j] } } 2.2 Gabungan For i = 0 to Ubound[B] { For j = 0 to Ubound[A] If B[i]< >A[j] Nilai = nilai + 1 If nilai > A.length – 1 Nilai = 0 } } 2.3 Komplemen For i = 0 to Ubound[S] {
  • 13. For j = 0 to Ubound[A] If S[i]< >A[j] Nilai2 + = 1 If nilai2 > A.length – 1 Nilai2 = 0 } } 2.4 Selection Irisan For i = 0 to selec_irisan.length – 1{ m=i for q = i + 1 to selec_irisan.length – 1 if selec_irisan [q] < selec_irisan [m] m=0 if m < > i n= selec_irisan [i] selec_irisan [i] = selec_irisan [m] selec_irisan [m] = n } }
  • 14. 2.5 Selection Gabungan For i = 0 to selec_gabungan.length – 1{ min = i for j = i + 1 to selec_gabunga.length – 1 if selec_gabungan [j] < selec_gabungan [min] min = j if min < > i temp = selec_gabungan [i] selec_ gabungan [i] = selec_gabungan [min] selec_ gabungan [min] = temp } } 2.6 Selection Komplemen For i = 0 to selec_komplemen.length – 1{ km = i for j = i + 1 to selec_komplemen.length – 1 if selec_komplemen [j] < selec_komplemen [km] km = j
  • 15. if km < > i kp = selec_komplemen [i] selec_komplemen [i] = selec_komplemen [km] selec_komplemen [km] = kp } }
  • 17. BAB IV SOURCE Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dipilih() As Char = {".", ",", "*", " "} Dim f, g, h As String Dim nilai, nilai2 As Integer nilai = 0 nilai2 = 0 f = TextBox1.Text g = TextBox2.Text h = TextBox3.Text Dim A() As String = f.Split(dipilih) Dim B() As String = g.Split(dipilih) Dim S() As String = h.Split(dipilih) 'irisan For i = 0 To UBound(A) For j = 0 To UBound(B) If A(i) = B(j) Then ListBox1.Items.Add(A(i)) End If Next Next 'gabungan For i = 0 To UBound(A) ListBox2.Items.Add(A(i)) Next For i = 0 To UBound(B) For j = 0 To UBound(A) If B(i) <> A(j) Then nilai = nilai + 1 End If Next If nilai > A.Length - 1 Then ListBox2.Items.Add(B(i)) End If nilai = 0 Next 'komplemen
  • 18. For i = 0 To UBound(S) For j = 0 To UBound(A) If S(i) <> A(j) Then nilai2 += 1 End If Next If nilai2 > A.Length - 1 Then ListBox3.Items.Add(S(i)) End If nilai2 = 0 Next End Sub Private Sub Label13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label13.Click Refresh() TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" ListBox1.Text = "" ListBox2.Text = "" ListBox3.Text = "" End Sub Private Sub Label15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label15.Click MsgBox("muhammad sukron" + vbCrLf + "10610067") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'sort irirsan Dim i, r, q, m, n As Integer r = ListBox1.Items.Count - 1 Dim selec_irisan(r) As Integer For i = 0 To r selec_irisan(i) = ListBox1.Items(i) Next For i = 0 To selec_irisan.Length - 1 m = i For q = i + 1 To selec_irisan.Length - 1
  • 19. If selec_irisan(q) < selec_irisan(m) Then m = q End If Next If m <> i Then n = selec_irisan(i) selec_irisan(i) = selec_irisan(m) selec_irisan(m) = n End If Next For p = 0 To selec_irisan.Length - 1 TextBox4.AppendText(" " + CStr(selec_irisan(p))) Next 'sort gabungan Dim min, temp, y As Integer y = ListBox2.Items.Count - 1 Dim selec_gabungan(y) As Integer For i = 0 To y selec_gabungan(i) = ListBox2.Items(i) Next For i = 0 To selec_gabungan.Length - 1 min = i For j = i + 1 To selec_gabungan.Length - 1 If selec_gabungan(j) < selec_gabungan(min) Then min = j End If Next If min <> i Then temp = selec_gabungan(i) selec_gabungan(i) = selec_gabungan(min) selec_gabungan(min) = temp End If Next For p = 0 To selec_gabungan.Length - 1 TextBox5.AppendText(" " + CStr(selec_gabungan(p))) Next 'sort komplemen Dim km, kp, z As Integer z = ListBox3.Items.Count - 1 Dim selec_komplemen(z) As Integer
  • 20. For i = 0 To z selec_komplemen(i) = ListBox3.Items(i) Next For i = 0 To selec_komplemen.Length - 1 km = i For j = i + 1 To selec_komplemen.Length - 1 If selec_komplemen(j) < selec_komplemen(km) Then km = j End If Next If km <> i Then kp = selec_komplemen(i) selec_komplemen(i) = selec_komplemen(km) selec_komplemen(km) = kp End If Next For p = 0 To selec_komplemen.Length - 1 TextBox6.AppendText(" " + CStr(selec_komplemen(p))) Next End Sub End Class