O'Reilly logo

Learn to Program with Small Basic by Ed Price, Majed Marji

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required