Upload
oma
View
28
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Study Maze 5.05. Looping Structures. Click On Your Character. The input box is a …?. A. B. dialog box that pops up and prompts the user for input. Text area that pops up and prompts the user for to wait while it gets input. The input box is a …?. A. B. - PowerPoint PPT Presentation
Citation preview
STUDY MAZE 5.05
Looping Structures
Click On Your Character
The input box is a …?
A Bdialog box that
pops up and prompts the
user for input
Text area that pops up and prompts the user for to wait while it gets input
The input box is a …?
A Bdialog box that
pops up and prompts the
user for input
Text area that pops up and prompts the user for to wait while it gets input
What is the most common name for a counter variable?
A Bi x
What is the most common name for a counter variable?
A Bi x
Accumulator variable is useful for …?
A. B.Keeping the loop
runningKeeping a
running total
Accumulator variable is useful for …?
A. B.Keeping the loop
runningKeeping a
running total
The four types of loops are …?
A. B.Do WhileDo…Loop WhileFor…NextFor Each…Next
Do WhileDo…Loop WhileFor…NextDo For …Next
The four types of loops are …?
A. B.Do WhileDo…Loop WhileFor…NextFor Each…Next
Do WhileDo…Loop WhileFor…NextDo For …Next
A posttest is …?
A. B.Test the condition BEFORE the loop runs. If the condition is false the loop will not execute.
Run the loop one time then test the condition- if the condition is false the loop will then terminate
A posttest is …?
A. B.Test the condition BEFORE the loop runs. If the condition is false the loop will not execute.
Run the loop one time then test the condition- if the condition is false the loop will then terminate
Do While … Loop Syntax?
A. B.Do While conditionStatementsLoop
Do conditionStatementsLoop While
Do While … Loop Syntax?
A. B.Do While conditionStatementsLoop
Do conditionStatementsLoop While
When should you use a for next loop?
A. B.when you know how many times the loop will run
when a variable is used in the condition.
When should you use a for next loop?
A. B.when you know how many times the loop will run
when a variable is used in the condition.
Winner
The syntax for an input box is …?
A. B.StrVariable = InputBox (prompt, title) StrVariable = InputBox “prompt,
title”
The syntax for an input box is …?
A. B.StrVariable = InputBox (prompt, title) StrVariable = InputBox “prompt,
title”
What makes an accumulator variable different from a counter variable?
A. B. the value
that updates the
accumulator changes
It adds up all values
What makes an accumulator variable different from a counter variable?
A. B. the value
that updates the
accumulator changes
It adds up all values
Looping =?
A. B.Circles Repeated
actions
Looping =?
A. B.Circles Repeated
actions
What are two different ways to test a condition?
A. B.Pretest
and Prosttest
Pretestand
Protest
What are two different ways to test a condition?
A. B.Pretest
and Prosttest
Pretestand
Protest
A pretest loop only executes if the condition is for at least one time
A. B.False True
A pretest loop only executes if the condition is for at least one time
A. B.False True
Do … Loop While Syntax?
A. B.Do StatementsLoop While condition
Do StatementsLoop (condition)
Do … Loop While Syntax?
A. B.Do StatementsLoop While condition
Do StatementsLoop (condition)
When should you use a While Loop?
A. B.when a
variable is used in the condition
when you know how
many times the loop will
run
When should you use a While Loop?
A. B.when a
variable is used in the condition
when you know how
many times the loop will
run
Winner
When dealing with loops you also may use a to determine the number of times a loop executes.
A.
counter variable
B.
Accumulator Variable
When dealing with loops you also may use a to determine the number of times a loop executes.
A.
counter variable
B.
Accumulator Variable
Syntax for an accumulator variable is …?
A.accumulator = accumulator + valueaccumulator += value
B.accumulator = accumulator + variableaccumulator += variable
Syntax for an accumulator variable is …?
A.accumulator = accumulator + valueaccumulator += value
B.accumulator = accumulator + variableaccumulator += variable
An iteration is …?
A.Every time
the loop returns to
the top
B.Each time the loop runs
An iteration is …?
A.Every time
the loop returns to
the top
B.Each time the loop runs
A pretest is …?
A.Test the condition BEFORE the loop runs. If the condition is false the loop will not execute.
B.Run the loop
one time then test the condition- if
the condition is false the
loop will then terminate
A pretest is …?
A.Test the condition BEFORE the loop runs. If the condition is false the loop will not execute.
B.Run the loop
one time then test the condition- if
the condition is false the
loop will then terminate
A posttest loop will _____ execute at least one time.
A.NEVER
B.ALWAYS
A posttest loop will _____ execute at least one time.
A.NEVER
B.ALWAYS
For Next Loop Syntax
A.For counter = start To end
StatementsNext counter
B.For counter = start To end
Statementsloop
For Next Loop Syntax
A.For counter = start To end
StatementsNext counter
B.For counter = start To end
Statementsloop
A flag is …?
A.A condition
used to signify that a loop should
stop executing
B.A condition
used to signify that a loop should continue to
execute
A flag is …?
A.A condition
used to signify that a loop should
stop executing
B.A condition
used to signify that a loop should continue to
execute
Winner