Popular Post

Popular Posts

Rabu, 01 Juni 2016





Sebelum kita membuat tampilan di atas adapun langka - langka yang sangat panjang di bawah ini, semoga anda sabar untuk membuat program ini.......... langsung saja saya mulai bagaimana cara membuantnya :

1. di saind terlebih dahulu seperti gambar di atas
2. dable klik di button masukkan data, lalu masukkan scrib di bawah ini
 
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        N = N + 1
        Data(N) = CDbl(TextBox2.Text)
        Banyak = CDbl(TextBox1.Text)
        If N <= Banyak Then
            Listbox.Items.Add("Data Angka Ke-" & "" & N & " =" & " " & TextBox2.Text)
        ElseIf N > Banyak Then
            TextBox2.Text = ""
            N = Banyak
            MsgBox("Data Yang Dimasukkan Sudah Melewati Batas!!")
        End If
        TextBox2.Text = ""
        TextBox2.Focus()
    End Sub

3. dable klik di buttonAscending masukkan scrib ini

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim i, j As Integer
        For i = 1 To N
            For j = i + 1 To N
                If Data(i) < Data(j) Then
                    temp = Data(i)
                    Data(i) = Data(j)
                    Data(j) = temp
                End If
            Next j
        Next i
        Listbox.Items.Add("===========================================")
        Listbox.Items.Add("Hasil Urutan Data Dari Terbesar Ke Terkecil")
        For i = 1 To N
            Listbox.Items.Add(Data(i))
        Next i
        Listbox.Items.Add("===========================================")
    End Sub

4. Duble klik di buttonDescending dan masukkan scrib di bawah ini

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim i, j As Integer
        For i = 1 To N
            For j = i + 1 To N
                If Data(i) > Data(j) Then
                    temp = Data(i)
                    Data(i) = Data(j)
                    Data(j) = temp
                End If
            Next j
        Next i
        Listbox.Items.Add("===========================================")
        Listbox.Items.Add("Hasil Urutan Data Dari Terkecil Ke Terbesar")
        For i = 1 To N
            Listbox.Items.Add(Data(i))
        Next i
        Listbox.Items.Add("===========================================")
    End Sub

5. untuk mencari nilai max maka harus masukkan scrib di bawah ini

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Dim i As Integer
        Max = Data(1)
        For i = 1 To N
            If Data(i) > Max Then Max = Data(i)
        Next i
        Listbox.Items.Add("===========================================")
        Listbox.Items.Add("Nilai Yang Terbesar Adalah = " & Max)
        Listbox.Items.Add("===========================================")
    End Sub

6. sedangkan untuk nilai min

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        Dim i As Integer
        Min = Data(1)
        For i = 1 To N
            If Data(i) < Min Then Min = Data(i)
        Next i
        Listbox.Items.Add("===========================================")
        Listbox.Items.Add("Nilai Yang Terkecil Adalah = " & Min)
        Listbox.Items.Add("===========================================")
    End Sub

7. klu yang ini untuk mencari letak X sebagi berikut

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim i As Integer
        Dim x As Integer
        x = CDbl(TextBox3.Text)
        i = 1
        While (i < N) And (Data(i) <> x)
            i = i + 1
        End While
        While (i > N) And (Data(i) <> x)
            i = i + 1
        End While
        If Data(i) = x Then
            posisi = i
            Listbox.Items.Add("======================================")
            Listbox.Items.Add("Terletak Pada Posisi Data Angka Ke-" & posisi)
            Listbox.Items.Add("======================================")
        Else
            posisi = 0
            Listbox.Items.Add("======================================")
            Listbox.Items.Add("Ups..Maaf, Data Tidak Ditemukan!!")
            Listbox.Items.Add("======================================")
        End If
    End Sub
End Class

8. jika sudah selesai selanjutnya run program tersebut





mungkin hanya itu yang dapat saya jelaskan jika ada kekurangan maklumi saja karena saya masih newbie ...... heheheh see you bye... :-D

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Computers Chip - Devil Survivor 2 - Powered by Blogger - Designed by Johanes Djogan -