ch06 - Microsoft Visual Basic 2008: Reloaded Third Edition...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Six The Do Loop and List Boxes
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 2 Objectives After studying this chapter, you should be able to: Include the Do loop in both pseudocode and a flowchart Write a Do…Loop statement Initialize counters and accumulators Display a dialog box using the InputBox function Refresh the screen
Background image of page 2
Microsoft Visual Basic 2008: Reloaded, Third Edition 3 Objectives (continued) Delay program execution Enable and disable a control
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 4 The Repetition Structure Repetition structure (or loop ): a structure that repeatedly processes one or more program instructions until a condition is met Pretest loop The condition is evaluated before the instructions within the loop are processed The instructions may be processed zero or more times Posttest loop The condition is evaluated after the instructions within the loop are processed The instructions are always processed at least once
Background image of page 4
Microsoft Visual Basic 2008: Reloaded, Third Edition 5 The Repetition Structure (continued) Repetition statements in Visual Basic Do. ..Loop For. ..Next For Each. ..Next
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 6 The Do. ..Loop Statement Do. ..Loop statement : codes both a pretest or posttest loop Use While or Until to code the condition for the loop Repetition symbol in a flowchart is the diamond
Background image of page 6
Microsoft Visual Basic 2008: Reloaded, Third Edition 7 The Do. ..Loop Statement (continued) Figure 6-1: How to use the Do…Loop statement
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 8 The Do. ..Loop Statement (continued) Figure 6-1: How to use the Do…Loop statement (continued)
Background image of page 8
The Do. ..Loop Statement (continued) Microsoft Visual Basic 2008: Reloaded, Third Edition 9 Figure 6-2: Processing steps for the pretest loop example
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 10 The Do. ..Loop Statement (continued) Figure 6-3: Processing steps for the posttest loop example
Background image of page 10
Microsoft Visual Basic 2008: Reloaded, Third Edition 11 The Do. ..Loop Statement (continued) Figure 6-4: Pseudocode and flowchart for the pretest loop example
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 12 The Do. ..Loop Statement (continued) Figure 6-5: Pseudocode and flowchart for the posttest loop example
Background image of page 12
Microsoft Visual Basic 2008: Reloaded, Third Edition 13 The Do. ..Loop Statement (continued) Figure 6-6: Examples showing that the pretest and posttest loops do not always produce the same results
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
14 Using Counters and Accumulators Counter : a numeric variable used for counting Accumulator : a numeric variable used for accumulating (adding together) Initializing : assigning a beginning value to a counter or accumulator variable Updating (or incrementing ): adding a number to
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 50

ch06 - Microsoft Visual Basic 2008: Reloaded Third Edition...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online