What you'll build
- A program to organize lunch provisions at the school cafeteria.
What you'll learn
- How to define and use enumerations, or
enums.
- When it makes sense to use an
enum.
- How enumerations make your code easier to write and understand.
Key vocabulary
Introduction
Imagine a small lunch counter that has a menu of only five entrees, two drinks, and three desserts. How do they plan how many items they’ll need to prepare? How can they be most efficient in handling orders?
In this lesson, you'll learn about types that can have a limited number of values. Using these types, you can write code that knows exactly what inputs to expect.
Go Build
Open the Enums and Switch.playground file in your course resources and follow the instructions.

Reflection Questions
An enum is useful for modeling a limited number of related values.
What real-world properties could you use an enum to describe?
Just as importantly, what real-world properties would not work well as an enum?
Summary
You’ve seen how useful enums can be when you want to write code that deals with a limited set of possible values. In the next lesson, you'll get some experience catching errors in your code—and ensuring that it works correctly under all circumstances.