 In the preceding video, we had to ask for input twice, once before entering the loop, and again at the bottom of the loop to get the next number. Here it is in the code, where we do the input outside the loop, and again inside the loop at the bottom. Depending on your philosophy of programming, this is inelegant because it duplicates code. We'd like to do the input only once inside the loop. Here's the pseudocode. The key is to set a Boolean variable that tells us whether we want to keep going with the loop or not. The initial value is 1, meaning true, because we're just starting and we definitely want to keep going in that case. As long as we want to keep going, we ask for the age in years. Say the user enters 30. 30 is not equal to 0, which means we calculate and display 30 times 365. The else clause is skipped, and we loop back to test the condition. Keep going is still true, which means we do the loop body again. We ask for the age in years again, and this time let's have the user enter 0. This time, the if condition is false. 0 is equal to 0. We take the else clause and set keep going to 0, meaning false, and loop back to test the condition. Now the condition evaluates as false, and that ends the loop. Let's put that into the code, starting with a version that doesn't have a loop in it yet. We'll add our Boolean variable here and set it to true, and then we'll put in our while loop with the condition. As long as we want to keep going, take the body of the loop and indent it and put in the closing brace. After we get the input, we need to test to see if it's 0 or not. We say if years is not equal to 0, indent the body of the if and put in its closing brace, then add the else clause, which sets keep going to 0. False. Let's build and run. And the program lets us enter ages as many as we want until we type 0 and the program finishes. And that's how using a Boolean to control the loop lets you write a program that needs only one input within the loop.