Senin, 25 Januari 2016

MENENTUKAN DERET BILANGAN

MENENTUKAN DERET BILANGAN
ASSALAMU'ALAIKUM WARAHMATULLAHI WABAROKATUH :)
 
SELAMAT DATANG DI BLOG SAYA, SAYA AKAN MEMPOSTING MENGENAI  PROGRAM VISUAL BASIC 10 YANG SAYA BUAT

PROJECT LATIHAN   12

BERIKUT ADALAH CODING MENENTUKAN DERET BILANGAN:

Public Class Formlat12
    Dim jumlah, deret As Integer
    Sub bilderet()
        Dim banyak, n As Integer

        banyak = Val(Me.TxtJumlah.Text)
        n = 1
        Me.LsDeret.Items.Clear()
        While (n <= banyak)
            deret = n ^ 2

            Me.LsDeret.Items.Add(n & "" & deret)
            n = n + 1


        End While
    End Sub

    Private Sub Formlat12_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        utama.Enabled = True
        utama.Show()
        Me.Hide()
    End Sub

    Private Sub Formlat12_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        utama.Enabled = True
        utama.Show()
        Me.Hide()
    End Sub

    Private Sub TxtJumlah_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtJumlah.TextChanged
        Call bilderet()
    End Sub
End Class

Tidak ada komentar:

Posting Komentar