Loops Flashcards
Continuously reading temperature from a sensor until it falls below a certain threshold.
While Loop
Calculating the total sum of numbers in an array
For Loop
Multiplying two matrices together, where you need to iterate over rows and columns.
Nested Loops
Displaying a menu to a user and executing their choice, then repeating until they choose to exit
Do-While Loop
a loop that repeatedly executes the loop body while the loop’s expression evaluates to true
while loop
a loop that typically describes iterating for a specific number of times
for loop
a loop that appears in the body of another loop. The nested loops are commonly referred to as the inner loop and outer loop
nested loop
a loop that first executes the loop body’s statements, then checks the loop condition
do-while loop
Iterate through a list of orders to calculate the total sales for the day
For Loop
Continuously prompt the user for a command until they enter “exit” to terminate the program
While Loop
Creating a multiplication table, where you iterate over rows and columns to display results
Nested Loops
Prompt the user to enter a valid password and repeat until the entered password meets the criteria
Do-While Loop