1/36
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
what does a while loop do
perfom code while a condition is true
what does a until loop do
perform code until a condition becomes true
what does a for loop do
perform code once for each item in a list
what does a select loop do
list a set of choices from which the user makes a selection
what is a nested loop?
loop placed in the block of code of another loop
any loop type can be nested in itself or any other loop type (t/f)
true
how many layers can you nest loops?
none, there is no limit
what are the three separate commands in a while loop?
while , done
the
true
in a while loop, the code is repeated until the
false, it is repeated until the
if the
true
if the
false, code is skippped to the next command after 'done'
what is the opposite of a while loop?
an until loop
what are the three separate commands in an until loop?
until , done
in a until loop, the code will repeat until the
true
in an until loop, if the
true
if the
true
what are the two types of for loops?
standard and three expression
what is a three expression for loop used for?
numeric processing
there is a $ in the variable in a for loop (t/f)
false
what is 'seq'?
external program that creates a sequne of space delimited values
what is the 'seq' equivalent in BSD?
jot
what is the syntax for seq?
seq
what does seq increment by?
if
it defaults to 1
if
it defaults to 1
seq can be used for the for loop
true
the select loop is used for what type of user interaction?
user input
how is user input decided in a select loop?
choices are presented in a numbered list
what happens if a valid selection is made?
the variable is set
a code block is ran
the choices are represented again
in a select loop, what happens if a valid selection is NOT made?
the varibale is NOT set and the choices are represented again
is the code block executed if a valid selection if NOT made?
no, code block is NOT executed
how can you break out of a loop?
'break' command
'break' is always required in what type of loop
select
how can you skip to the next value early?
use 'continue'
what does 'continue' do?
stop processing the code block and go to the next value (if it exists)
'continue' can be used for error tapping (t/f)
true