2 Decisions, Decisions
Once you know how to do input, output, and data calculations, you’re on your way to writing real C++ programs. But there’s more to programming than that. The most useful programs have behavior: the ability to respond to conditions.
In effect, computers make decisions. That’s what this chapter is all about.
We’ll start by looking at some simple programs. By the end of the chapter, you’ll have the tools to do something interesting: perform a prime-number test. For large numbers especially, that job is a difficult one for humans, but it’s perfect for a computer.
But First, a Few Words about Data Types
But before you look at computer decision-making, it’s important to understand data. Ultimately, all information on a computer ...