Repetition
Repetition
JEFFREY A. ALARCON
ICT 202
OBJECTIVES
• Discuss and enumerate the different repetition
structures.
• Recognize the differences of the structure of
Repetition statement.
A short review: (Case Block
statement)
Repetition
In this lesson, we shall examine another way to control the program
flow, that is, the repetition structure. A repetition statement that both
defines the boundaries containing the repeating section of code and
controls whether the code will be executed or not
Repetition:
LOGIC OF REPETITION:
Using this condition gives a false value, since the program will just print numbers that are less than and equal to 10
Example 2
Performance task 2
Use any of the repetition statements in this program, which will allows
the user to enter three incorrect, passwords before is disabled. If the
password is equal to “COMPUTER”, then label displays “ACCESS
GRANTED”, else , it will display “TRY AGAIN”. However, if the user has
entered three incorrect passwords, the form will be disabled.
Assignments:
1. Define For…loop statement
2. Syntax
3. Give one sample program of for…loop statement
4. Quiz