1 / 16

Clearly Visual Basic: Programming with Visual Basic 2008

Clearly Visual Basic: Programming with Visual Basic 2008. Chapter 16 I’m on the Inside; You’re on the Outside. Objectives. Nest repetition structures Utilize a text box’s Multiline, ReadOnly, and ScrollBars properties. One Loop within Another Loop. Repetition structures can be nested

sburks
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 16 I’m on the Inside; You’re on the Outside

  2. Objectives • Nest repetition structures • Utilize a text box’s Multiline, ReadOnly, and ScrollBars properties Clearly Visual Basic: Programming with Visual Basic 2008

  3. One Loop within Another Loop • Repetition structures can be nested • Programmer • Determines whether a problem’s solution requires a nested repetition structure • Figure 16-1 • Shows problem specification and algorithm from Chapter 13 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. Clock Application • Clock • Uses nested repetition structures to keep track of the time • The minute hand • Controlled by the inner (nested) loop • The hour hand is controlled by the outer loop • Figure 16-3 • Shows logic used by a clock’s hour and minute hands • Figure 16-4 • Shows interface for the Clock application Clearly Visual Basic: Programming with Visual Basic 2008

  7. Clearly Visual Basic: Programming with Visual Basic 2008

  8. Clearly Visual Basic: Programming with Visual Basic 2008

  9. Revisiting the Monthly Payment Calculator Application • Figure 16-6 • Shows the output, processing, input items, and algorithm for the Monthly Payment Calculator application • Application calculates and displays: • Monthly payments on a loan • Payments are calculated using: • Principal and term entered by the user, along with a loop that varies the annual interest rates from 4% through 7% Clearly Visual Basic: Programming with Visual Basic 2008

  10. Clearly Visual Basic: Programming with Visual Basic 2008

  11. Clearly Visual Basic: Programming with Visual Basic 2008

  12. Revisiting the Monthly Payment Calculator Application (continued) • ScrollBars property • Indicates whether any scroll bars appear on the text box • Multiline property • Specifies whether the text can span more than one line in the control • Setting the text box’s ReadOnly property to True • Prevents the user from editing the contents of a text box Clearly Visual Basic: Programming with Visual Basic 2008

  13. Clearly Visual Basic: Programming with Visual Basic 2008

  14. But I Want To Do It a Different Way • Use two Do…Loop statements or one For…Next statement and one Do…Loop statement Clearly Visual Basic: Programming with Visual Basic 2008

  15. Summary • Repetition structures can be nested • For a nested repetition structure to work correctly: • It must be contained entirely within the outer repetition structure • When a text box’s Multiline property is set to True: • It can accept multiple lines of text Clearly Visual Basic: Programming with Visual Basic 2008

  16. Summary (continued) • A text box’s ScrollBars property • Determines whether scroll bars appear on the control • Setting the text box’s ReadOnly property to True • Prevents the user from editing the contents of a text box Clearly Visual Basic: Programming with Visual Basic 2008

More Related