8MAKING DECISIONS WITH IF STATEMENTS

image

Which shirt should I wear? What should I have for dinner? Where should I go? Should I wear my pants so low that my underwear shows? You ask yourself questions like these and answer them every day. Just as you make decisions, your programs can too! Of course, they won’t do this on their own. Your programs only make the comparisons you want them to make, and then they either run some statements or skip them. In this chapter, you’ll write programs that can make decisions.

The programs you’ve written so far followed a simple path where the statements execute from top to bottom. But sometimes you might need to run ...

Get Learn to Program with Small Basic 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.