Chapter06 Slides

# Chapter06 Slides - Click to edit Master subtitle style...

This preview shows pages 1–13. Sign up to view the full content.

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Click to edit Master subtitle style Oppor tunity Chapter 6: Loops MIS 304 Introduction to Problem Solving and Programming You will lear n how to… • Describe how loops make repetition of commands possible • Recognize the blocks of code that form a loop structure • Create and use For...Next loops • Draw and use loop structures in a flowchart • Increment and decrement a loop and use the Step parameter You will lear n how to… • Create and use both types of While and Until loops • Answer the standard loop questions when shown a loop structure • Create and use nested loops • Create and use the Exit For command You will lear n how to… • Use the Chr and Asc commands • manage the location of controls using the Top and Left properties • Use loops to move images around the screen Loops • Life is filled with repetition • Tasks that get repeated create a loop • Loops are the third basic tool in a developer’s toolkit (sequence, selection, repetition) What Ar e Loops? • Loop- a series of commands that are repeated • Loops create a block of code and must be treated as a block of code • Every loop has a condition that controls when it runs and stops – Some loops run a specified number of times – Some loops until a condition is met Loop Questions • Must be able to answer several questions whenever you spot a loop • Developers have internalized the questions but still use them to understand a loop Loop Questions • Where Does It Start? – What line starts a loop – Always starts with either For or Do • Where Does It End? – What line is the last line of the loop – Last line starts with Next or Loop • First and last lines of a loop align vertically • Everything in between is a part of the loop Loop Questions • What Controls the Loop? – Might be an assignment statement, input statement or a calculation – This line is crucial to understand how the loop ends • How Many Times Does It Loop? – For...Next loops have start value and end value – While and Until loops might repeat a set number of times when a counter is used – Might be controlled by input and the exact number of iterations cannot be Loop Questions • Is It Top-Driven or Bottom-Driven? – Pretest – a loop where the condition that controls the loop is placed at the top of the loop – Posttest – a loop where the condition that controls the loop is placed at the bottom of the loop • Top-driven is a pretest loop • Bottom-driven is a posttest loop Loop Questions • Is It Top-Driven or Bottom-Driven? – Both types have their uses – Developers must understand when and why to use them Loop Questions • What type of loop should I use?...
View Full Document

## This note was uploaded on 11/29/2010 for the course MIS 304 taught by Professor Mote during the Fall '08 term at University of Texas.

### Page1 / 75

Chapter06 Slides - Click to edit Master subtitle style...

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

View Full Document
Ask a homework question - tutors are online