Chapter 7. Decisions, Decisions

In the first few chapters, we saw some of the basic building blocks of a program. We can now make a program with input, processing, and output. We can even make our input and output a little fancier by using a GUI. We can assign the input to a variable, so we can use it later, and we can use some math to process it. Now we’re going to start looking at ways to control what the program does.

If a program did the same thing every time, it would be a little boring and not very useful. Programs need to be able to make decisions on what to do. We’re going to add some different decision-making techniques to our processing repertoire.

Testing, testing

Programs need to be able to do different things based on their input. ...

Get Hello World! Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.