U3: Loops Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Loops

A
  • Allow programmer to see patterns in problems and write program accordingly
  • Limited code repeats infinitely
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Infinite Loop

A

Loop that doesn’t stop (not good for program)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

For Loop [A]

A
  • Exists in wide variety of languages; works similarly in all
  • Has built-in variable keeping track of no. of loop executes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

For Loop [B]

A
  • Starts at certain number; ends at certain number
  • Can be incremented or decremented by given number
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Purpose of For Loop

A
  • When times loop needed to execute already known
  • When variable used to indicate no. of loop executes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

While Loops

A
  • Used when programmer doesn’t know no. of times loop needs to repeat
  • while; do while
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

“While” Loop

A

Used for executing loop +0 times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

“Do While” Loop

A

Used for executing loop +1 times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

System.out.print vs. system.out.println

A
  • System.out.print prints in single line repeatedly
  • System.out.println prints in different lines repeatedly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How User Input Influences Loops

A

Can change no. of times loop executes; exit program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Data Structure

A
  • Specific way to organize large amounts of same type of data
  • Can store, process and output data
  • Arrays, stacks, queues, linked lists
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Nested Loops

A

Loops inside of loops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly