Chapter 6: Applying Conditional Logic


OVERVIEW

For your application to be truly effective, it must be able to make decisions. It must be able to distinguish between two different situations and execute different code based on criteria you choose. For example, when examining user input, you can use conditional logic to alter the flow of your program, causing it to execute only those sections of code that are relevant. This allows you to create applications that respond dynamically and give the user an interactive experience. In this chapter, you learn how to apply conditional logic using variations of the if and switch statements. You also gain a better understanding of this logic through development of this chapter's game project, the Guess a Number game.

In this chapter, you learn the following:

  • How to test two logical conditions

  • How to provide for alternative courses of action

  • How to embed conditional statements to create more complicated conditional logic tests

  • How to rest multiple conditions against a single value




Microsoft Visual C++ 2005 Express Edition Programming for the Absolute Beginner 2006
Microsoft Visual C++ 2005 Express Edition Programming for the Absolute Beginner 2006
ISBN: 735615381
EAN: N/A
Year: 2005
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net