Pages

Diberdayakan oleh Blogger.

Kamis, 16 Oktober 2014

MEMBUAT PROGRAM DERET MAJU DAN MUNDUR PADA VISUAL BASIC

Membuat Program Deret Maju dan Mundur :
·        
           Membuat 1 buah Label, 1 buah textbox, dan 4 buah command button : Maju,Mundur,Clear,Exit
·       Membuat Koding:
Dim s As Integer                                               = Sebagai variabel
Private Sub Command1_Click()                  = tombol Maju
Print
Print
Print
Print
s = Text1.Text
For a = 1 To s
For b = 1 To a
Print b;
Next b
Print
Next a
For c = s - 1 To 1 Step -1
For d = 1 To c
Print d;
Next d
Print
Next c

End Sub


Private Sub Command2_Click()                                  = Tombol Mundur
Print
Print
Print
For e = s To 1 Step -1
For f = 1 To e
Print f;
Next f
Print
Next e
For g = 1 To s
For h = 1 To g
Print h;
Next h
Print
Next g
End Sub

Private Sub Command3_Click()                                  = Tombol Clear
Text1.Text = " "
Form1.Refresh                                                                  =Untuk membersihkan layar form
End Sub

Private Sub Command4_Click()                                  = tombol Exit
End


End Sub

Tamplan program : 



0 komentar:

Posting Komentar