5.15. Wrap-UpIn this chapter, we demonstrated two of Visual Basic's selection statementsthe If...Then single-selection statement and the If...Then...Else double-selection statement. The If...Then statement is used to execute a set of one or more statements based on a conditionif the condition is true, the statements execute; if it is false, the statements are skipped. The If...Then...Else double-selection statement is used to execute one set of statements if a condition is true, and another set if the condition is false. We discussed the While and Do While...Loop repetition statements, where a set of statements is executed repeatedly as long as a loop-continuation condition remains true. We discussed the Do Until...Loop repetition statement, where a set of statements is executed repeatedly as long as a loop-termination condition remains false. We used control-statement stacking to compute the average of a set of student grades with counter-controlled repetition and then with sentinel-controlled repetition, and we used control-statement nesting to analyze and make decisions based on a set of exam results, and also to display a square of fill characters. We introduced compound assignment operators, which can be used for abbreviating assignment statements. The chapter concluded with an introduction to adding event handlers to a GUI application. You modified a GUI application programmatically. In Chapter 6, Control Statements: Part 2, we present additional selection and repetition statements. In the next few chapters, we build Windows applications that interact more with the user. |