To control when to start and stop a loop, we can create a variable outside the loop and use it as the condition.

This loop repeats while isHungry is true. Since the loop sets isHungry to false, it only runs once.