February 25, 2010.  The BDE(Begin-During-End) event.  Worksheet – Exercise # 9 Instructions  2nd Period Test.

Slides:



Advertisements
Similar presentations
Decision Structures - If / Else If / Else. Decisions Often we need to make decisions based on information that we receive. Often we need to make decisions.
Advertisements

How SAS implements structured programming constructs
Do-while Loops Programming. COMP102 Prog Fundamentals I: do-while Loops /Slide 2 The do-while Statement l Syntax do action while (condition) l How it.
Chapter 13 Control Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Control Structures Conditional.
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Events Chapter 7. Interactive Real world is interactive User determines order of actions instead of programmer.
Repetition control structures
CHAPTER 5: Repetition Control Structure. Objectives  To develop algorithms that use DOWHILE and REPEAT.. UNTIL structures  Introduce a pseudocode for.
Loops (Part 1) Computer Science Erwin High School Fall 2014.
Intro to Programming Algebra-Geometry. Computer Programming? What is programming? The process of writing, testing, and maintaining the source code of.
Visual Basic.NET BASICS Lesson 10 Do Loops. 2 Objectives Explain what a loop is. Use the Do While and Do Until loops. Use the InputBox function. Use the.
Repeating Actions While and For Loops
Executes a statement or statements for a number of times – iteration. Syntax for(initialize; test; increment) { // statements to be executed } Initial.
A loop is a repetition control structure. it causes a single statement or block to be executed repeatedly What is a loop?
Fall 2007ACS-1805 Ron McFadyen1 Chapter 7 Repetition.
Repetition Statements repeat block of code until a condition is satisfied also called loops Java supports 3 kinds of loops: while statement – repeats a.
1 Lecture 14 Chapter 6 Looping Dale/Weems/Headington.
Programming: Simple Control Structures Alice. Control Statements We have been using Do in order and Do together to control the way instructions are executed.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley This week: Whew!!! The last homework was tough! The homework for this week.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
Chapter 61 More about Loop Do ….. Loop Write Down “Do” and “Loop”
Study Guide For Test Chapter 5, 6,& 7 Test is Friday, May 15th.
Flow of Control. 2 Control Structures Control structure: An instruction that determines the order in which other instructions in a program are executed.
Events Chapter 7 Part 2. While a Key is Pressed Event Specialized event An event occurs when you press a key and continues until you take your finger.
Engineering 1020 Introduction to Programming Peter King Winter 2010.
Lecture 8: Choosing the Correct Loop. do … while Repetition Statement Similar to the while statement Condition for repetition only tested after the body.
Four Fundamental Pieces Instruction Control Structure Function Expression.
ㅎㅎ logical operator if if else switch while do while for Third step for Learning C++ Programming Repetition Control Structures.
PHP Constructs Advance Database Management Systems Lab no.3.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 ‏ Control Structures.
Mathematical Expressions, Conditional Statements, Control Structures
CMP-MX21: Lecture 5 Repetitions Steve Hordley. Overview 1. Repetition using the do-while construct 2. Repetition using the while construct 3. Repetition.
ITERATIVE STATEMENTS. Definition Iterative statements (loops) allow a set of instruction to be executed or performed several until condition are met.
Pascal Programming Iteration (looping) Carl Smith National Certificate Unit 4.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Using Loops. Goals Understand how to create while loops in JavaScript. Understand how to create do/while loops in JavaScript. Understand how to create.
ITEC 109 Lecture 11 While loops. while loops Review Choices –1 st –2 nd to ?th –Last What happens if you only use ifs? Can you have just an else by itself?
EXEMPLARY READING DOCUMENT Do you believe the following statements are true or false? Be ready to discuss your answers.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Repetition Control Structure. Introduction Many applications require certain operations to be carried out more than once. Such situations require repetition.
1 For Loops l From Chapter 9 l A shorthand way of coding count loops.
Copyright © 2012 Pearson Education, Inc. Chapter 5: Loops.
Programming: Simple Control Structures Sec 46 Web Design.
Chapter 7: The Repetition Structure Introduction to Programming with C++ Fourth Edition.
P ROGRAMMING L OGIC GWDA123 Sharon Kaitner, M.Ed. Winter 2015: Week 2.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Control Structures WHILE Statement Looping. S E Q C E N U E REPITITION …a step or sequence of steps that are repeated until some condition is satisfied.
Chapter 5: Looping. Using the while Loop Loop – A structure that allows repeated execution of a block of statements Loop body – A block of statements.
Modulus Operator #include main() { int a, b, q, r; printf(" a b a/b a%b\n"); while (scanf("%d%d", &a, &b) != EOF) { q = a / b; /* quotient */ r = a % b;
Conditional Statements A conditional statement lets us choose which statement will be executed next Conditional statements give us the power to make basic.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
Karel J Robot Chapter 6.
Chapter 5: Loops and Files.
Simple Control Structures
CiS 260: App Dev I Chapter 4: Control Structures II.
Chapter 6 Repetition Objectives ❏ To understand basic loop concepts:
Iteration with While You can say that again.
Lecture Notes – Week 3 Lecture-2
Topics: Number Sense Inversion Additive Composition
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Iteration Implemented through loop constructs (e.g., in C++)
Repetition Control Structure
Chapter 8: More on the Repetition Structure
Control structures to direct program flow
Find the reference angle for the angle measuring {image}
Flow of Control.
Relational Operators.
PROGRAM FLOWCHART Iteration Statements.
Repetition Structures
True or False True or False
Presentation transcript:

February 25, 2010

 The BDE(Begin-During-End) event.  Worksheet – Exercise # 9 Instructions  2nd Period Test

In a While statement, actions occur while some condition remains true. Sometimes, we would like to make an action occur when the condition becomes false and the loop ends. The problem is how to make actions repeat (within a loop) but also make an action occur each time the loop ends? The answer is Use an BDE (Begin-During-End) event!

 Alice has a built-in While statement event for linking events to repeated actions. Select a While something is true event from the pull- down menu causes a While event block to be added to the Events editor.  This will block contains a Begin-During-End (BDE) block that allows you to specify what happens when the loop begins, during execution of the loop, and when the loop ends.

You need the following information:  A conditional expression (evaluates to true or false)  Begin – A method or instructions that is to be done once, at the time it becomes true.  During – A method or instructions that is to be done repeatedly, as long as the condition remains true.  End – A method or instructions that is to be done once, at the time the condition becomes false.

 Finish today’s worksheet.  You also have yesterday’s worksheet.  Test on Chapter 7 will be 2 nd period. Get ready!