3

MAKING CHOICES

image

Now that we’ve covered how to create constants and variables, you’re ready to learn how to tell your computer to make choices. This chapter is about controlling the flow of a computer program by telling the computer which path to take. When we talk about flow, we’re referring to the order in which the statements of the program are executed.

Up to this point, you’ve only seen statements performed in the order you’ve typed them. You’ve done some cool things with this, but by telling the computer how to make choices about the order of executing statements, you can do even more. To get the computer to make a choice, we’ll use conditional ...

Get Coding iPhone Apps for Kids, 1st Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.