Hasil : Picture box Do-while loop < 3 (command 1) Do- loop while < 3 (command 2) Do-until loop < 3 (command 3) Do- loop until < 3 (command 4) End (command 5) Ulangi (command 6)
Private Sub Command1_Click() Dim number As Integer number = Val(Text1.Text) Do While number < 3 Picture1.Print number number = number + 1 Loop
End Sub
Private Sub Command2_Click() Dim number As Integer number = Val(Text1.Text) Do Picture2.Print number number = number + 1 Loop While number < 3
End Sub
Private Sub Command3_Click() Dim number As Integer number = Val(Text1.Text) Do Picture3.Print number number = number + 1 Loop Until number > 3
End Sub
Private Sub Command4_Click() Dim number As Integer number = Val(Text1.Text) Do Picture4.Print number number = number + 1 Loop Until number > 3
End Sub
Private Sub Command5_Click() End End Sub
Private Sub Command6_Click() txtAwal = "" Picture1.Cls Picture2.Cls Picture3.Cls Picture4.Cls
End Sub
Private Sub Command1_Click() End End Sub Private Sub Command2_Click() Picture1.Cls If Val(Text1.Text) Mod 2 = 1 Then Label2.Caption = "Nilai Kuadratnya =" Picture1.Print Val(Text1.Text) ^ 2 Label3.Caption = "Bilangan Ganjil" Else Label2.Caption = "Nilai setengahnya" Picture1.Print Val(Text1.Text) / 2 Label3.Caption = "Bilangan genap" End If
End Sub
Private Sub Command3_Click() Txt = " " Picture1.Cls
End Sub
Private Sub Command1_Click() End End Sub
Private Sub Command2_Click() Dim xlama, xbaru As Double Dim n_iterasi, Max_iterasi As Integer Dim kesalahan, toleransi As Double