Loops Flashcards

1
Q

Continuously reading temperature from a sensor until it falls below a certain threshold.

A

While Loop

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

Calculating the total sum of numbers in an array

A

For Loop

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

Multiplying two matrices together, where you need to iterate over rows and columns.

A

Nested Loops

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

Displaying a menu to a user and executing their choice, then repeating until they choose to exit

A

Do-While Loop

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

a loop that repeatedly executes the loop body while the loop’s expression evaluates to true

A

while loop

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

a loop that typically describes iterating for a specific number of times

A

for loop

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

a loop that appears in the body of another loop. The nested loops are commonly referred to as the inner loop and outer loop

A

nested loop

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

a loop that first executes the loop body’s statements, then checks the loop condition

A

do-while loop

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

Iterate through a list of orders to calculate the total sales for the day

A

For Loop

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

Continuously prompt the user for a command until they enter “exit” to terminate the program

A

While Loop

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

Creating a multiplication table, where you iterate over rows and columns to display results

A

Nested Loops

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

Prompt the user to enter a valid password and repeat until the entered password meets the criteria

A

Do-While Loop

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