What you'll build
- A program to determine if a given year is a leap year.
What you'll learn
- How to compare values.
- How to use the results of comparisons to choose which lines of code to run in your apps.
Key vocabulary
Introduction
Imagine you’re asked to make dinner and given a bunch of ingredients. Depending on the ingredients, you’ll follow a different set of steps. If you have lettuce, you’re not going to put it on the grill. In this lesson, you’ll learn how to add decision-making capabilities to your programs, so they can do different things depending on the information they’re given.
Go Build
Open the Making Decisions.playground file in your course resources and follow the instructions.

Reflection Questions
Think of a set of instructions you’d write for someone looking after your cat for the day.
How many of the steps would have conditionals attached to them? For example, if the food bowl is empty, you’d want them to top it up.
Almost every task involves making a decision.
Can you list out the decisions you make when getting ready in the morning?
What information do you need?
What different things do you do as a result of those decisions?
Summary
Using if and else statements represents an important fundamental technique in program development. When your code can make decisions based on the information it’s given, your programs will be able to solve a variety of interesting problems.
Conditionals make your programs more powerful but also make them more complicated. To keep your programs understandable and manageable, you can use functions to hide complicated or multistep decisions.
Next, you'll look at a fun way to apply your knowledge to power a dancing robot.