Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
This chapter is from the book

4.13 Wrap-Up

This chapter presented basic problem-solving techniques that you use to build programs. We demonstrated how to develop an algorithm in pseudocode, evolving it through several refinements until it is ready to be translated to Visual Basic code that can be executed. This process is called top-down, stepwise refinement.

You learned that only three types of control structures—sequence, selection and repetition—are needed to develop an algorithm. We demonstrated the If...Then single-selection statement and the If...Then...Else double-selection statement. The If...Then statement is used to execute an action (or sequence of actions) based on a condition—if 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 Do While...Loop and While...End While repetition statements that execute sets of statements repeatedly as long as a loop-continuation condition remains true. We discussed the Do Until...Loop repetition statement, where a set of statements executes repeatedly as long as a loop-termination condition remains false. You studied the UML activity diagrams that represent each control statement presented in the chapter.

We introduced compound assignment operators, which can be used for abbreviating assignment statements. We used control-statement stacking to compute a class average with counter-controlled repetition then display the results, and we used control-statement nesting to analyze and make decisions based on a set of exam results. You also learned how to use the debugger to view the values of variables during program execution and to step through a program to help locate a logic error. In Chapter 5, Problem Solving and Control Statements: Part 2, we present additional selection and repetition statements.

  • + Share This
  • 🔖 Save To Your Account