Hour 13. Making Decisions in Visual C# .NET Code
In Hour 10, “Creating and Calling Methods,” you learned how to separate code into multiple methods so that the methods can be called in any order required. This 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 that you use to execute (or omit) code based on the current situation, such as the value of a variable. Visual C# .NET includes two constructs that enable you to make any type of branching decision you can think of: if...else and switch.
In this hour, you'll learn how to use the decision ...
Get Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours 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.