Recall & Review
beginner
What does an
if statement do in Flutter?An
if statement checks a condition and runs code only if that condition is true. It helps the app decide what to do next.Click to reveal answer
beginner
How does a
for loop work in Flutter?A
for loop repeats a block of code a set number of times. It’s like telling the app to do something again and again.Click to reveal answer
intermediate
What is the purpose of a
while loop?A
while loop keeps running code as long as a condition stays true. It’s useful when you don’t know how many times you need to repeat beforehand.Click to reveal answer
intermediate
Explain the
switch statement in Flutter.A
switch statement checks a value and runs code for the matching case. It’s like choosing a path based on different options.Click to reveal answer
beginner
Why is control flow important in mobile apps?
Control flow lets apps make decisions and repeat tasks. It helps apps respond to user actions and show the right screens or data.
Click to reveal answer
What will this
if statement do if the condition is false?<br>if (isLoggedIn) {
showHomePage();
}✗ Incorrect
If the condition is false, the code inside the
if block does not run, so nothing happens.How many times will this
for loop run?<br>for (int i = 0; i < 3; i++) {
print(i);
}✗ Incorrect
The loop runs while
i is less than 3, so it runs 3 times with i values 0, 1, and 2.What happens if the
while loop condition is never true?✗ Incorrect
If the condition is false at the start, the
while loop does not run any code.Which statement best describes a
switch?✗ Incorrect
A
switch selects which block of code to run depending on the value it checks.Why use control flow in a mobile app?
✗ Incorrect
Control flow helps the app decide what to do and repeat actions when needed.
Describe how an
if statement controls app behavior.Think about how the app decides to do something only sometimes.
You got /3 concepts.
Explain the difference between a
for loop and a while loop.One counts how many times, the other checks a condition each time.
You got /4 concepts.