CNIT 340 Loops

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

37 Terms

1
New cards

what does a while loop do

perfom code while a condition is true

2
New cards

what does a until loop do

perform code until a condition becomes true

3
New cards

what does a for loop do

perform code once for each item in a list

4
New cards

what does a select loop do

list a set of choices from which the user makes a selection

5
New cards

what is a nested loop?

loop placed in the block of code of another loop

6
New cards

any loop type can be nested in itself or any other loop type (t/f)

true

7
New cards

how many layers can you nest loops?

none, there is no limit

8
New cards

what are the three separate commands in a while loop?

while , do , done

9
New cards

the in a while loop can be a command (t/f)

true

10
New cards

in a while loop, the code is repeated until the is true (t/f)

false, it is repeated until the is NOT true

11
New cards

if the is true, a while loop executes commands between 'do' and 'done' (t/f)

true

12
New cards

if the is not true, the code is reevaluated and tries until it is done (t/f)

false, code is skippped to the next command after 'done'

13
New cards

what is the opposite of a while loop?

an until loop

14
New cards

what are the three separate commands in an until loop?

until , do , done

15
New cards

in a until loop, the code will repeat until the equals true (t/f)

true

16
New cards

in an until loop, if the is not true, the code between 'do' and 'done' will be executed (t/f)

true

17
New cards

if the is true in an until loop, skip to the next command after 'done' (t/f)

true

18
New cards

what are the two types of for loops?

standard and three expression

19
New cards

what is a three expression for loop used for?

numeric processing

20
New cards

there is a $ in the variable in a for loop (t/f)

false

21
New cards

what is 'seq'?

external program that creates a sequne of space delimited values

22
New cards

what is the 'seq' equivalent in BSD?

jot

23
New cards

what is the syntax for seq?

seq

24
New cards

what does seq increment by?

25
New cards

if is ommitted...

it defaults to 1

26
New cards

if is ommitted...

it defaults to 1

27
New cards

seq can be used for the for loop (t/f)

true

28
New cards

the select loop is used for what type of user interaction?

user input

29
New cards

how is user input decided in a select loop?

choices are presented in a numbered list

30
New cards

what happens if a valid selection is made?

the variable is set

a code block is ran

the choices are represented again

31
New cards

in a select loop, what happens if a valid selection is NOT made?

the varibale is NOT set and the choices are represented again

32
New cards

is the code block executed if a valid selection if NOT made?

no, code block is NOT executed

33
New cards

how can you break out of a loop?

'break' command

34
New cards

'break' is always required in what type of loop

select

35
New cards

how can you skip to the next value early?

use 'continue'

36
New cards

what does 'continue' do?

stop processing the code block and go to the next value (if it exists)

37
New cards

'continue' can be used for error tapping (t/f)

true

Explore top flashcards

Obras y su autores
Updated 968d ago
flashcards Flashcards (37)
ANNEX A
Updated 64d ago
flashcards Flashcards (32)
LAB MICRO PARCIAL 2
Updated 999d ago
flashcards Flashcards (73)
unit 6
Updated 699d ago
flashcards Flashcards (94)
Obras y su autores
Updated 968d ago
flashcards Flashcards (37)
ANNEX A
Updated 64d ago
flashcards Flashcards (32)
LAB MICRO PARCIAL 2
Updated 999d ago
flashcards Flashcards (73)
unit 6
Updated 699d ago
flashcards Flashcards (94)