Thursday, September 27, 2007

Decisions and Loops

Decisions and Loops
In this chapter, we will look at how to add decision-making capabilities to your C++ programs. You will also learn how to make your programs repeat a set of actions until a specific condition is met. This will enable you to handle variable amounts of input, as well as make validity checks on the data that you read in. You will also be able to write programs that can adapt their actions depending on the input data, and to deal with problems where logic is fundamental to the solution. By the end of this chapter you will have learnt:
How to compare data values
How to alter the sequence of program execution based on the result
What logical operators and expressions are and how you can apply them
How to deal with multiple choice situations
How to write and use loops in your programs
We will start with one of the most powerful programming tools: the ability to compare variables and expressions with other variables and expressions and, based on the outcome, execute one set of statements or another.

No comments: