Professional Documents
Culture Documents
02BSCE04 BES043
1. DO LOOP - It repeats the enclosed block of statements while a Boolean condition is True or
until the condition becomes True. It could be terminated at any time with the Exit Do
statement.
Example:
Module loops
Sub Main()
' local variable definition
Dim a As Integer = 10
'do loop execution
Do
Console.WriteLine("value of a: {0}", a)
a = a + 1
Loop While (a < 20)
Console.ReadLine()
End Sub
End Module
2. DO UNTIL LOOP- is used when we want to repeat a set of statements as long as the
condition is false. The condition may be checked at the beginning of the loop or at the end of
loop.
Example:
Example:
<!DOCTYPE html>
<html>
<body>
<script language = "vbscript" type = "text/vbscript">
i = 10
Do Until i>15 'Condition is False.Hence loop will be
executed
i = i + 1
Document.write("The value of i is : " & i)
Document.write("<br></br>")
Loop
</script>
</body>
</html>
4. DO WHILE LOOP- is used when we want to repeat a set of statements as long as the condition
is true. The condition may be checked at the beginning of the loop or at the end of the loop.
Example:
Example:
Module loops
Sub Main()
' local variable definition
Dim i, j As Integer
For i = 2 To 100
For j = 2 To i
' if factor found, not prime
If ((i Mod j) = 0) Then
Exit For
End If
Next j
If (j > (i \ j)) Then
Console.WriteLine("{0} is prime", i)
End If
Next i
Console.ReadLine()
End Sub
End Module
6. FOR NEXT LOOPS- It repeats a group of statements a specified number of times and a loop
index counts the number of loop iterations as the loop executes.
Example:
Module loops
Sub Main()
Dim a As Byte
' for loop execution
For a = 10 To 20
Console.WriteLine("value of a: {0}", a)
Next
Console.ReadLine()
End Sub
End Module
7. LIST BOX- represents a Windows control to display a list of items to a user. A user can select
an item from the list. It allows the programmer to add items at design time by using the
properties window or at the runtime.
Example:
ARRAYS- a kind of data structure that can store a fixed-size sequential collection of elements of the
same type. An array is used to store a collection of data, but it is often more useful to think of an
array as a collection of variables of the same type.
8. POS SYSTEM: Point of sale (POS) system is the spot where your customer makes the payment
for goods or services that are offered by your company. Point of sale systems are systems that
enable the business transaction between the client and the company to be completed. A point of
sale purchase or payment is the specific point in time when a financial transaction takes place
through a POS system.
For example, if you decide to buy two products and take them to the checkout counter, the staff there
would scan the products and create a receipt
VIDAL, JAYSON A.
02BSCE04 BES043
1. DO LOOP - It repeats the enclosed block of statements while a Boolean condition is True
or until the condition becomes True. It could be terminated at any time with the Exit Do
statement.
Example:
Module loops
Sub Main()
' local variable definition
Dim a As Integer = 10
'do loop execution
Do
Console.WriteLine("value of a: {0}", a)
a = a + 1
Loop While (a < 20)
Console.ReadLine()
End Sub
End Module
2. DO UNTIL LOOP- is used when we want to repeat a set of statements as long as the
condition is false. The condition may be checked at the beginning of the loop or at the end
of loop.
Example:
Example:
<!DOCTYPE html>
<html>
<body>
<script language = "vbscript" type = "text/vbscript">
i = 10
Do Until i>15 'Condition is False.Hence loop will be
executed
i = i + 1
Document.write("The value of i is : " & i)
Document.write("<br></br>")
Loop
</script>
</body>
</html>
4. DO WHILE LOOP- is used when we want to repeat a set of statements as long as the
condition is true. The condition may be checked at the beginning of the loop or at the end
of the loop.
Example:
Example:
Module loops
Sub Main()
' local variable definition
Dim i, j As Integer
For i = 2 To 100
For j = 2 To i
' if factor found, not prime
If ((i Mod j) = 0) Then
Exit For
End If
Next j
If (j > (i \ j)) Then
Console.WriteLine("{0} is prime", i)
End If
Next i
Console.ReadLine()
End Sub
End Module
6. FOR NEXT LOOPS- It repeats a group of statements a specified number of times and a loop
index counts the number of loop iterations as the loop executes.
Example:
Module loops
Sub Main()
Dim a As Byte
' for loop execution
For a = 10 To 20
Console.WriteLine("value of a: {0}", a)
Next
Console.ReadLine()
End Sub
End Module
7. LIST BOX- represents a Windows control to display a list of items to a user. A user can
select an item from the list. It allows the programmer to add items at design time by using
the properties window or at the runtime.
Example:
ARRAYS- a kind of data structure that can store a fixed-size sequential collection of elements of the
same type. An array is used to store a collection of data, but it is often more useful to think of an
array as a collection of variables of the same type.
8. POS SYSTEM: Point of sale (POS) system is the spot where your customer makes the
payment for goods or services that are offered by your company. Point of
sale systems are systems that enable the business transaction between the client and the
company to be completed. A point of sale purchase or payment is the specific point in time
when a financial transaction takes place through a POS system.
For example, if you decide to buy two products and take them to the checkout counter, the staff there
would scan the products and create a receipt