Vous êtes sur la page 1sur 3

QUESTION 1 CODING FOR FORM: Public Class Form1 Dim multiplier As Integer Dim answer As Integer Dim i As Integer

Private Sub btnKlikUntukSifirTujuh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKlikUntukSifirTujuh.Click multiplier = 7 Do While multiplier < 8 For i = 1 To 13 Step +2 answer = i * multiplier ListBox1.Items.Add(i & "X" & multiplier & "=" & answer) Next i multiplier = multiplier + 1 Me.Show() Loop End Sub End Class

INTERFACE OUTPUT:

QUESTION 2 CODING FOR FORM 1: Public Class Form1 Dim i As Integer = 1 Dim num As Integer Dim total As Integer Dim n As Integer Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click n = txtNumber.Text While (i <= n) num = InputBox("Please enter value" & i & " : ") total = total + num i = i + 1 End While MessageBox.Show(" The Sum Is " & total / n, "Result") End Sub End Class OUTPUT INTERFACE: