This document contains information about a Visual Studio application created by Asep Anwar Sanusi, a student with NPM 19402111 in class SI-XW41/19. The application contains groupboxes and controls to demonstrate for, while, and do-while loops by taking input range values, running the loops, and outputting results to a list. The code examples show how each loop structure is implemented to iterate from the start to end values and add the results to the list.
This document contains information about a Visual Studio application created by Asep Anwar Sanusi, a student with NPM 19402111 in class SI-XW41/19. The application contains groupboxes and controls to demonstrate for, while, and do-while loops by taking input range values, running the loops, and outputting results to a list. The code examples show how each loop structure is implemented to iterate from the start to end values and add the results to the list.
This document contains information about a Visual Studio application created by Asep Anwar Sanusi, a student with NPM 19402111 in class SI-XW41/19. The application contains groupboxes and controls to demonstrate for, while, and do-while loops by taking input range values, running the loops, and outputting results to a list. The code examples show how each loop structure is implemented to iterate from the start to end values and add the results to the list.
2. Pada halaman ini kita akan membuat desain dari program yang akan kita buat
3. Properties
Object Property Nilai
Groupbox1 Pengulangan For, While dan Do Groupbox2 Hasil Label1 Nilai Awal Label2 Nilai Akhir Textbox1 Txt_nawal Textbox2 Txt_nakhir Button1 Bt_next For - Next Button2 Bt_While While - End While Button3 Bt_do Do While - Loop Button4 Bt_bersih Bersihkan Listbox1 List_hasil List_hasil 4. Tampilan
5. Koding
Public Class Form1
Private Sub Bt_next_Click(sender As Object, e As EventArgs) Handles
Bt_next.Click Dim x, y As Integer x = Val(Txt_nawal.Text) y = Val(Txt_nakhir.Text) For i = x To y List_hasil.Items.Add(i) Next End Sub
Private Sub Bt_while_Click(sender As Object, e As EventArgs) Handles
Bt_while.Click Dim x As Integer x = Val(Txt_nawal.Text) While x <= Val(Txt_nakhir.Text) List_hasil.Items.Add(x) x = x + 1 End While End Sub
Private Sub Bt_do_Click(sender As Object, e As EventArgs) Handles Bt_do.Click
Dim x As Integer x = Val(Txt_nawal.Text) Do While x <= Val(Txt_nakhir.Text) List_hasil.Items.Add(x) x = x + 1 Loop End Sub
Private Sub Bt_bersih_Click(sender As Object, e As EventArgs) Handles
Bt_bersih.Click Txt_nawal.Clear() Txt_nakhir.Clear() List_hasil.Items.Clear() End Sub End Class