1 / 19

Clearly Visual Basic: Programming with Visual Basic 2008

Clearly Visual Basic: Programming with Visual Basic 2008. Chapter 14 Do It, Then Ask Permission. Objectives. Write a posttest loop using the Do…Loop statement Show a posttest loop in both pseudocode and a flowchart Concatenate strings. Testing after the Fact.

lhilton
Download Presentation

Clearly Visual Basic: Programming with Visual Basic 2008

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 14 Do It, Then Ask Permission

  2. Objectives • Write a posttest loop using the Do…Loop statement • Show a posttest loop in both pseudocode and a flowchart • Concatenate strings Clearly Visual Basic: Programming with Visual Basic 2008

  3. Testing after the Fact • Instructions in a pretest loop • May never be processed • Instructions in a posttest loop • Will be processed at least once • Figure 14-1 • Shows the problem specification and algorithms Clearly Visual Basic: Programming with Visual Basic 2008

  4. Clearly Visual Basic: Programming with Visual Basic 2008

  5. Clearly Visual Basic: Programming with Visual Basic 2008

  6. Clearly Visual Basic: Programming with Visual Basic 2008

  7. Clearly Visual Basic: Programming with Visual Basic 2008

  8. More on the Do … Loop Statement Pretest syntax The {While | Until}condition section Part of the Do clause Indicates that the condition is evaluated before the loop instructions are processed Posttest syntax The {While | Until}condition section Part of the Loop clause Indicates that the condition is evaluated after the loop instructions are processed Clearly Visual Basic: Programming with Visual Basic 2008

  9. Clearly Visual Basic: Programming with Visual Basic 2008

  10. Pseudocode and Flowchart for a Posttest Loop • Figure 14-4 • Shows the pseudocode and flowchart for Example 2 in Figure 14-3 • The repetition diamond • Appears at the bottom of the loop in a posttest loop Clearly Visual Basic: Programming with Visual Basic 2008

  11. Clearly Visual Basic: Programming with Visual Basic 2008

  12. The Good Morning Application • Figure 14-5 • Shows the interface for the Good Morning application • Figure 14-6 • Shows each message on a separate line in the control • Figure 14-7 • Shows the pretest and posttest loops in the Good Morning application • Describes the way the computer processes the code in each loop when the user enters the number 0 Clearly Visual Basic: Programming with Visual Basic 2008

  13. Clearly Visual Basic: Programming with Visual Basic 2008

  14. Clearly Visual Basic: Programming with Visual Basic 2008

  15. Clearly Visual Basic: Programming with Visual Basic 2008

  16. Clearly Visual Basic: Programming with Visual Basic 2008

  17. But They Said There Were No Strings Attached • Concatenation operator • The ampersand (&) • Used to concatenate (connect or link) strings together • ControlChars.NewLine constant • Represents the Enter key on your keyboard • Used to create a new line Clearly Visual Basic: Programming with Visual Basic 2008

  18. Clearly Visual Basic: Programming with Visual Basic 2008

  19. Summary • Instructions in a posttest loop • Will be processed at least once • Do…Loop statement • Used to code a posttest loop • To concatenate strings • Use the concatenation operator: ampersand (&) • Enter key • Represented by the ControlChars.NewLine constant Clearly Visual Basic: Programming with Visual Basic 2008

More Related