You are on page 1of 2

Nama : Rizqi Tri Atmojo

NIM : 1610512012
Kelas : Bahasa Pemograman VB (B)

Penjelasan

Konfigurasi nama :
Listbox1 = Listbox1
Radiobutton1 = DE JA
VU
Radiobutton2 = Do
While
Radiobutton3 = While
End
Textbox1 = Textbox1
Button1 = Proses
Button2 = Kosongkan

Konfigurasi Syntax
Public Class Form1
Dim a As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim b, c, d, f As String
a = TextBox1.Text
If RadioButton1.Checked Then
If RadioButton2.Checked Then
b = " DE"
c = " JA"
d = " VU"
f = b + c + d
a = 1
Do While a <= Val(TextBox1.Text)
If a Mod 3 = 0 And a Mod 2 <> 0 And a Mod 5 = 0 Then
ListBox1.Items.Add(a & f)
ElseIf a Mod 3 = 0 And a Mod 2 <> 0 And a Mod 5 <> 0 Then
ListBox1.Items.Add(a & b + c)
ElseIf a Mod 3 = 0 And a Mod 5 = 0 Then
ListBox1.Items.Add(a & b + d)
ElseIf a Mod 2 <> 0 And a Mod 5 = 0 Then
ListBox1.Items.Add(a & c + d)
ElseIf a Mod 3 = 0 Then
ListBox1.Items.Add(a & b)
ElseIf a Mod 2 <> 0 Then
ListBox1.Items.Add(a & c)
ElseIf a Mod 5 = 0 Then
ListBox1.Items.Add(a & d)
Else
ListBox1.Items.Add(a)
End If
a = a + 1
Loop
End If
If RadioButton3.Checked Then
b = " DE"
c = " JA"
d = " VU"
f = b + c + d
a = 1
While a <= Val(TextBox1.Text)
If a Mod 3 = 0 And a Mod 2 <> 0 And a Mod 5 = 0 Then
ListBox1.Items.Add(a & f)
ElseIf a Mod 3 = 0 And a Mod 2 <> 0 And a Mod 5 <> 0 Then
ListBox1.Items.Add(a & b + c)
ElseIf a Mod 3 = 0 And a Mod 5 = 0 Then
ListBox1.Items.Add(a & b + d)
ElseIf a Mod 2 <> 0 And a Mod 5 = 0 Then
ListBox1.Items.Add(a & c + d)
ElseIf a Mod 3 = 0 Then
ListBox1.Items.Add(a & b)
ElseIf a Mod 2 <> 0 Then
ListBox1.Items.Add(a & c)
ElseIf a Mod 5 = 0 Then
ListBox1.Items.Add(a & d)
Else
ListBox1.Items.Add(a)
End If
a = a + 1
End While

End If
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
ListBox1.Items.Clear()
ListBox1.Text = " "
TextBox1.Text = " "
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
End Sub

End Class

You might also like