Chapter 15 I’m on the Inside; You’re on the Outside (Nested Loops) Clearly Visual Basic: Programming with Visual Basic 2010 2 nd Edition.

Slides:



Advertisements
Similar presentations
Chapter 6: The Repetition Structure
Advertisements

Programming with Microsoft Visual Basic 2008 Fourth Edition
Programming with Microsoft Visual Basic th Edition
1.
Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Programming Logic and Design Eighth Edition
Programming with Microsoft Visual Basic th Edition
Microsoft Visual Basic: Reloaded Chapter Five More on the Selection Structure.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Eight Sub and Function Procedures.
Microsoft Visual Basic: Reloaded Chapter Six Repeating Program Instructions.
Excel and VBA Creating an Excel Application
VB Chapters 11 & 12 Security panel app chpt 12. Textbox Properties In the Interest Calculator we have a few new properties Multi-line property set to.
Repeating Program Instructions Chapter Microsoft Visual Basic.NET: Reloaded 1.
Programming with Microsoft Visual Basic th Edition CHAPTER SEVEN SUB AND FUNCTION PROCEDURES.
REPETITION STRUCTURES. Topics Introduction to Repetition Structures The while Loop: a Condition- Controlled Loop The for Loop: a Count-Controlled Loop.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter Four The Selection Structure
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Six Repeating Program Instructions.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
Chapter 10 Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms HTML5 & CSS 7 th Edition.
Clearly Visual Basic: Programming with Visual Basic 2008
Chapter 12: How Long Can This Go On?
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 5 Decision Making.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Seven More on the Repetition Structure.
Chapter 4: The Selection Structure
For Loops (ProjFor1, ProjFor2, ProjFor3, ProjFor4, textbox, textbox1) Please use speaker notes for additional information!
Programming Logic and Design Fifth Edition, Comprehensive
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Five More on the Selection Structure.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
Programming Logic and Design Sixth Edition Chapter 5 Looping.
1 Week 6 The Repetition Structure. 2 The Repetition Structure (Looping) Lesson A Objectives After completing this lesson, you will be able to:  Code.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
Chapter 6: The Repetition Structure
Tutorial 6 The Repetition Structure
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Six The Do Loop and List Boxes.
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 4 Looping.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Programming with Microsoft Visual Basic th Edition
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter Four The Selection Structure Programming with Microsoft Visual Basic th Edition.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 5 Repetition Structures.
For…Next Loops, Checked List Boxes, and Combo Boxes Chapter 5.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 16 I’m on the Inside; You’re on the Outside.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 13 How Long Can This Go On?
Chapter 13 Do It, Then Ask Permission (Posttest Loops) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 23 The String Section (String Manipulation) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 10 So Many Paths … So Little Time (Multiple-Alternative Selection Structures) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter Five More on the Selection Structure Programming with Microsoft Visual Basic th Edition.
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
 2003 Prentice Hall, Inc. All rights reserved. 1 Outline 11.1 Test-Driving the Interest Calculator Application 11.2 Essentials of Counter-Controlled Repetition.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
An Introduction to Programming with C++ Sixth Edition Chapter 8 More on the Repetition Structure.
Chapter 4: Do-It-Yourself Designing (Designing Interfaces)
Microsoft Visual Basic 2008: Reloaded Third Edition
Chapter 8: More on the Repetition Structure
Clearly Visual Basic: Programming with Visual Basic nd Edition
Repeating Program Instructions
Microsoft Visual Basic 2005: Reloaded Second Edition
Objectives After studying this chapter, you should be able to:
CIS 16 Application Development Programming with Visual Basic
Chapter 8: More on the Repetition Structure
Topics Introduction to Repetition Structures
Presentation transcript:

Chapter 15 I’m on the Inside; You’re on the Outside (Nested Loops) Clearly Visual Basic: Programming with Visual Basic nd Edition

Objectives Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 2 After studying Chapter 15, you should be able to: Nest repetition structures Utilize a text box’s Multiline, ReadOnly, and ScrollBars properties

One Loop within Another Loop Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 3 Repetition structures can be nested Programmer Determines whether a problem’s solution requires a nested repetition structure Figure 15-1 Shows problem specification and algorithm from Chapter 12

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 4 Figure 15-1 Problem specification and algorithm for signing one book for each customer

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 5 Figure 15-2 Problem specification and algorithm for signing zero or more books for each customer

Clock Application Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 6 Clock Uses nested repetition structures to keep track of time The second hand is controlled by the inner (nested) loop The minute hand is controlled by the outer loop Figure 15-3 shows logic used by clock’s minute and second hands Figure 15-4 shows interface for the Clock application

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 7 Figure 15-3 Logic used by a clock’s minute and second hands

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 8 Figure 15-4 Clock application’s user interface

Revisiting the Monthly Payment Calculator Application Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 9 Figure 15-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 A loop that varies the annual interest rates from 4% through 7%

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 10 Figure 15-6 Planning information for the Monthly Payment Calculator application from Chapter 14

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 11 Figure 15-7 Planning information for the modified Monthly Payment Calculator application

Revisiting the Monthly Payment Calculator Application (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 12 ScrollBars property Indicates whether any scroll bars appear on the text box Multiline property Specifies whether the text box can accept and display multiple lines of text Setting the text box’s ReadOnly property to True Prevents user from editing contents of a text box

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 13 Figure Click event procedure for the btnCalc control

But I Want To Do It a Different Way Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 14 Use two Do…Loop statements or one For…Next statement and one Do…Loop statement

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 15 Figure Modified Click event procedure for the btnCalc control

Summary Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 16 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 and display multiple lines of text

Summary (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 17 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 contents of a text box