Programs can make decisions based on certain conditions. This allows programs to check if something is true or false and then run the appropriate code. These are called “If statements” which are also known as “conditionals.”
“If This/Then That” statements are also called “conditional statements.” These statements tell the computer what to do depending on if a condition is true or false. In order to jump in a video game, the program will check if the button is pressed. If that is true, the character jumps. If that is false, it does nothing. Since a player can jump at any time, the game must check the button many times every second.
Select an activity below to download the PDF.
What is your favorite sport to play? If the game isn’t at your house, then how do you get there? If you win or lose, then how do you react?
Have you read other books that have “if this, then that” concepts? What did you learn?
Think about weather around the world. If it is hot or cold outside, then what do people wear or do? If a blizzard or hurricane is in the forecast, then how do people prepare?