Dalam program ini saya tidak membuat design nya,dikarenakan mengalami gangguan pada computer saya. Langkah-langkahnya sbb:
1. Properties yang digunakan
1 | Nilai awal | Label 1 | Text box 1 |
2 | Nilai akhir | Label 2 | Text box 2 |
3 | Proses | Button 1 |
|
4 | Bilangan yang habis 3,4 dan 7 | List box 1 |
|
5
6 | Bilangan yang tidak habis 3,4,dan 7
Menampilkan bilangan 7,8,14,16,28,32 | List box 2
List box 3 |
|
2. Kemudian sintaknya
Text box 1…click
Public class form 1
Sub bersih( )
Listbox1.items.clear ( )
Listbox2.items.clear ( )
Listbox3.items.clear ( )
Textbox1.T ext =” “
Textbox2.T ext =” “
End sub
sub proses1 ( )
Dim bil1 As Integer = Textbox1 . Text
Dim bil2 As Integer = Textbox2 . Text
For i = Bil1 to Bil2
If (i mod 3 = 0 ) And ( i mod 4 =0 ) And ( i mod 7 = 0 ) then
Listbox1.Items.Add ( i )
Else
Listbox2.Items.Add ( i )
End if
Next
End sub
Sub proses2 ( )
Dim bil1 As Integer = 1
Dim d , c As Integer
For i = 7 To 32
If i mod 7 = 0 then
Listbox3.Items.Add ( i )
C = c + 1
Listbox3.Items.Add ( i + c )
End if
Next
End sub
Private sub form1…load
Call bersih ( )
End sub
Private sub button1…click
Call proses1 ( )
Call proses2 ( )
End sub
Private sub Textbox1…text changed
End sub
End class
3. Selesai kemudian di running