530 likes | 678 Views
Microsoft Visual Basic 2008: Reloaded, Third Edition. 2. Objectives. After studying this chapter, you should be able to:Include the selection structure in pseudocode and in a flowchartWrite an If
E N D
1. Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Four
Making Decisions in a Program
2. Microsoft Visual Basic 2008: Reloaded, Third Edition 2 Objectives After studying this chapter, you should be able to:
Include the selection structure in pseudocode and in a flowchart
Write an IfThenElse statement
Write code that uses comparison operators and logical operators
Create a variable having block scope
Concatenate strings
3. Microsoft Visual Basic 2008: Reloaded, Third Edition 3 Objectives (continued) Use the ControlChars.NewLine constant
Change the case of a string
Generate random numbers
4. Microsoft Visual Basic 2008: Reloaded, Third Edition 4 The Selection Structure Selection structure (or decision structure):
Used to select a path to take based on the outcome of a decision or comparison
Condition:
The decision to be made
Results in a Boolean (True or False) answer
Four forms of selection structure:
If
If/Else
If/ElseIf/Else
Case
5. Microsoft Visual Basic 2008: Reloaded, Third Edition 5 The Selection Structure (continued)