

3rd prep lOOPING
Presentation
•
Computers
•
9th Grade
•
Practice Problem
•
Hard
Rabab Saudi
FREE Resource
3 Slides • 8 Questions
1
Loops
In the previous chapter, we have learned how
to execute a specific code, based on a
conditional expression.
In this chapter, you will learn how to repeat a
certain code for a number of times (which is
called Loops) using :
(For... Next) and (Do While... loop).
2
Comparison between Looping Statements
For …Next Statement
Do …. While Statement
It is one of the limited loop statements
used when we want to repeat a code for
specific number of time . It needs
numeric variable (integer or decimal) to
work as a counter with start value , end
value and add or increment value .
The statement 'Do while ... loop' is used
to repeat a specific code for a several
times of an unknown end, but based on a
specific condition, so they are useful if
you do not know the number of iterations
emphatically.
The repetitive code will be implemented
(executed) as long as the counter variable
is less than or equal the end value .The
loop stops when the value of the counter
exceeds the last value.
The repetitive code will be implemented
(executed) as long as the conditional
expression is true. If the condition is not
met for any reason, we get out of the
iterative loop, and implement the code
after the Loop if it exists.
General syntax for this statement
For Variable = Start To
End Step Add
Value
Repetitive Code
Next [Variable]
General syntax for this statement
Do While Conditional Expression
Repetitive Code
Loop
3
Multiple Choice
In ( For ..next ) looping statement the keyword step is a must.
True
False
4
Multiple Choice
To display the Odd Numbers arranged descending from 15 to 5 we write the codes
For M = 15 to 5 step - 2
For M = 15 to 5 step 2
For M = 15 to 5
5
Multiple Choice
In case the value of keyword Step in (For .. Next) loop takes zero, the loop will repeated infinite number of repetition and never stops.
True
False
6
Multiple Choice
Dim j As Integer
Label1.Text = ""
j = 2
Do While j <= 10
Me.Label1.Text = Label1.Text & vbCrLf & j
j = j + 2
Loop
The purpose of this Loop is to print ............................... from 2 to 10
Odd Numbers
Even Numbers
All Numbers
7
8
Multiple Choice
In the code :(ListBox1. Items. Add( m)) , Add is ………………..
Control
Property
Method
9
Multiple Choice
In case we don`t write the keyword Step in (For .. Next) loop it will take the initial value zero.
True
False
10
Multiple Choice
We use ---------------------- loop statement when we don`t know the number of repetition in advance.
If.......Then ....... Else
For.......Next
Do......While
11
Multiple Choice
Dim N , Sum as Integer
For N = 1 to 100
Sum= Sum + N
Next
Label1.Text = Sum
The Result of this Code is .........................
Displaying the numbers from 1 to 100
Displaying the sum of the numbers from 1 to 100.
Displaying the Product of the numbers from 1 to 100.
Loops
In the previous chapter, we have learned how
to execute a specific code, based on a
conditional expression.
In this chapter, you will learn how to repeat a
certain code for a number of times (which is
called Loops) using :
(For... Next) and (Do While... loop).
Show answer
Auto Play
Slide 1 / 11
SLIDE
Similar Resources on Wayground
10 questions
non- mendelian inheritance
Presentation
•
9th Grade
10 questions
Roman Catholic Church Middle Ages
Presentation
•
9th Grade
9 questions
Picoblox.ai
Presentation
•
9th Grade
7 questions
HAND TOOLS-CLASSIFICATION OF HARDWARE TOOLS
Presentation
•
9th Grade
9 questions
Animation Review
Presentation
•
9th Grade
8 questions
7.1 - Graphing Exponential Functions
Presentation
•
9th Grade
9 questions
Solving Systems: Substitution and Simple Elimination
Presentation
•
9th Grade
10 questions
Atomic Structure
Presentation
•
9th Grade
Popular Resources on Wayground
10 questions
HCS SCI 03 Summer School Review 4
Quiz
•
3rd Grade
11 questions
HSMS - Standard Response Protocol
Quiz
•
6th - 8th Grade
16 questions
1.1-1.2 Quiz Review
Quiz
•
9th - 12th Grade
12 questions
Exponent Expressions
Quiz
•
6th Grade
20 questions
Adding and Subtracting Integers
Quiz
•
6th - 7th Grade
11 questions
Northeast States
Quiz
•
3rd - 4th Grade
10 questions
Characterization
Quiz
•
3rd - 7th Grade
10 questions
Common Denominators
Quiz
•
5th Grade