Chapter 13. Making Decisions in Visual C# Code

<feature><title>What You’ll Learn in This Hour</title> <objective>

Making decisions using if statements

</objective>
<objective>

Expanding the capability of if statements using else

</objective>
<objective>

Evaluating an expression for multiple values using the switch statement

</objective>
</feature>

In Hour 10, “Creating and Calling Methods,” you learned to separate code into multiple procedures so that they can be called in any order required. This technique goes a long way in organizing code, but you still need a way to selectively execute code procedures or groups of statements within a procedure. You can use decision-making techniques to accomplish this. Decision-making constructs are coding structures ...

Get Sams Teach Yourself Visual C# 2008 in 24 Hours: Complete Starter Kit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.