Suppose I was supposed to get on a plane, what happens if I get to my gate on time? How about this one. If my smoke detector goes off, what should I do? And finally, if I have $20 in my bank account and I want to withdraw $10, what should happen? This one is a little different. Suppose I want to buy a shirt, it's $20, and I have this 5% off card. How much should I pay? Guess you've gotten the idea. These next we're going to be looking at these sorts of conditional situations. What was the word I said all the time there? If this, if I get to my gate on time, if the smoke alarm goes off, if I have $20 in my bank account, if I own this 5% off card. These are all situations in where something is going to happen, but not always, it's going to be conditional upon some particular situation. Let me give you a visual to help you really lay out all the possibilities that happen. Let's go back to getting to my airplane gate on time. Did I get to my gate before my plane leaves? If yes, then I get to get on my flight. If no, I do nothing, probably go nowhere, etc. Smoke alarm, same thing. Is my smoke alarm going off? If the answer is yes, I need to leave the building. No, then I do nothing, and I don't do both of these things, I do one or the other. It's either my smoke alarm is going off or it's not. ATM, if I want to withdraw $10 out, is $10 less than my my account balance? If it is yes, I can get that 10, otherwise, I really shouldn't get anything. And then finally, and in this one I'll point out is a little different, if I have this 5% off card and I want to buy a shirt that's $20, do I have a 5% off card? Yes, I am only going to pay $18. But no, instead of doing nothing, now I am going to do a different thing, which is I am going to pay the full price of $20. This represents what we call conditional execution, and there are a lot things that we do conditionally in our lives based on whether or not something is true or false. If it is true, we may do option one and if it's false, we'll do option two. So one of the key things about these conditional situations is they are really black and white. Okay, they're cut and dry, either one thing is true, check, I made it to the gate on time or it's not, false, I didn't make it to the gate on time. It's one or the other and it can never be both. That is a key part to these conditional situations. So just to introduce a little bit of computer science terminology to go along with your real world knowledge. This thing that we're asked about, if I'm at the gate, is the fire alarm going off, etc. We're going to call that a condition. And the yes and the no, we an replace those with Boolean values and if the condition is true, we're going to call it true, else it's false. So if I get to the gate on time, true, I get to get on the plane, else false, I didn't. Let's play one more game because you're about to go play this game for yourself in our next activity. Suppose I have a game where I'm going to draw a card from the deck, here's going to be our game rules. Got it? Ready to play? I'm going to ask you to play along at home even if you're on the bus or something. Just go ahead and clap quietly or say awwwwwe quietly. Ready? Here I'm drawing my first card. Hope you clapped, because that number is greater than four. So it's true and you should clap. Let's try playing again. Wait, higher than four. Is four higher than four? No, four is not greater than four, so false. Hopefully, you said awwwwwe. This can be a great activity to use with students, and we're going to give the opportunity to test out your own knowledge on a couple of different game designs based around playing cards. But before we do that, let me go ahead and introduce the block-based construct that is going to go along with these scenarios. So we've got this condition. If something is future, if I get to the gate on time, if the smoke alarm is going off, if I have more than $10 in my ATM. And when that thing is true, one thing happens, but otherwise, remember these all have the do nothing. So we just have an instruction, that will either happen, get on the plane or not. But we had another option here that's represented both by our 5% off card and the card game and that was that there would always be something that would happen. It was just conditional on whether you had the card or not or what card you drew in the deck. So if you had the 5% card, you only had to pay $18, else you had to pay $20, you had to pay for the shirt. If you're going to buy the shirt, you had to pay for it. It's a question of how much do you pay? So there is one instruction in the if part, and that it would be when it was true that you had the card. And if it's false, then you do what's in the else. Same way with the game of drawing cards from a deck of cards. If the number was greater than four, then you clapped, else then I said awwwwwe. So now you can go play some games.