You are on page 1of 3

QUEZON CITY UNIVERSITY

COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

Name: Danieli C. Escabas


Score Percentage
Student No.: 20-1366
Year/Section: BAIT 2B
DATE: November 05, 2021

INSTRUCTIONS:

1. Create a Windows Form program that will display the numbers from 1 to 1000. Your codes must
be less than 20 lines.

Source Code:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim counter, sum As Integer


For counter = 1 To 1000
sum = counter
ListBox1.Items.Add(sum)
Next

End Sub
End Class

Screenshot of the output:


QUEZON CITY UNIVERSITY
COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

2. Create a windows form program that will display the number from 1000 to 0. Your codes must
be less than 20 lines.

Source Code:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim counter As Integer = 1000


While counter >= 0
ListBox1.Items.Add(counter)
counter -= 1
End While

End Sub
End Class

Screenshot of the Output:


QUEZON CITY UNIVERSITY
COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY

3. Create a GUI program for Multiplication Table

Example:

Enter Number: ________ <- Textbox, for example, you are going to input multiplication table of 14

Source Code
Public Class MultiplicationTbl
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim num, res, inp As Integer
Dim final As String

inp = TextBox1.Text
TextBox2.Clear()

For num = 1 To 10
res = inp * num
TextBox2.AppendText(inp & "x" & num & "=" & res & Environment.NewLine)

Next
final = TextBox2.Text()
MessageBox.Show(final, "Multiplication Table", MessageBoxButtons.OK)
End Sub
End Class

Output

The output will be displayed in Message Box

You might also like