June 2006
Intermediate to advanced
1344 pages
42h 52m
English
As we have explained, the If...Then selection statement performs an indicated action (or sequence of actions) only when the condition evaluates to true; otherwise, the action (or sequence of actions) is skipped. The If...Then...Else selection statement allows you to specify that a different action (or sequence of actions) is to be performed when the condition is true than when the condition is false. For example, the Visual Basic statement
If studentGrade >= 60 Then Console.WriteLine("Passed") Else Console.WriteLine("Failed" End If
prints "Passed" if the student’s grade is greater than or equal to 60, and prints "Failed" if the student’s grade is less than 60. In either case, after printing occurs, ...
Read now
Unlock full access