You will learn the following in this chapter:
It is the computer's capability to make decisions that makes it useful. A computer program can measure data and make comparisons, and from those comparisons, the program can make decisions based on the data that is available to it. It's not that the computer can do something you and I can't do. However, the computer can do things much faster than we can. You and I can go through 100,000 files one-by-one and say, "Nope, that's not the one," and keep right on looking. Days later, we might find the name we are looking for and then proceed to the next step. What would take us days to accomplish the computer can accomplish in seconds. Like humans , the computer can say, "Nope, that's not the one," but it can do it thousands of times a second. Better still, it doesn't get bored, it doesn't get eye strain or headaches , and if the computer is properly programmed, it doesn't make mistakes. Even if the decision is a simple yes or no, being able to do it thousands of times a second is pretty powerful stuff.
This chapter explores some of the ways in which a program can make decisions. You have learned about the If statement in earlier chapters. You have not, however, seen the complete picture. In this chapter we dig into the details of how you can harness that the computer's power.