Do-more Technical Training Instruction Set (Program-Looping)

Slides:



Advertisements
Similar presentations
CMPS 1371 Introduction to Computing for Engineers
Advertisements

Iteration (Looping Constructs in VB) Iteration: Groups of statements which are repeatedly executed until a certain test is satisfied Carrying out Iteration.
Do/Loops A loop repeats a series of instructions. An iteration is a single execution of the statement(s) in the loop. Used when the exact number of iterations.
Computer Science 1620 Loops.
REPETITION (loops or iteration) Schneider: Sec. 6.1 & 6.3.
TESTING LOOPS ● Simple Loops ● Nested Loops ● Concatenated Loops ● Unstructured Loops.
Iteration (Looping Constructs in VB) Iteration: Groups of statements which are repeatedly executed until a certain test is satisfied Carrying out Iteration.
Iteration This week we will learn how to use iteration in C++ Iteration is the repetition of a statement or block of statements in a program. C++ has three.
CS 106 Introduction to Computer Science I 02 / 12 / 2007 Instructor: Michael Eckmann.
1 MATERI PENDUKUNG JUMP Matakuliah: M0074/PROGRAMMING II Tahun: 2005 Versi: 1/0.
TK2633: MICROPROCESSOR & INTERFACING
Repetition Statements repeat block of code until a condition is satisfied also called loops Java supports 3 kinds of loops: while statement – repeats a.
Loop Statements (Iteration). Iteration  A portion of a program that repeats a statement or group of statements is called a loop.  Each repetition of.
1 Pertemuan 06 Repetition Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Iteration Conditional Loops Counted Loops. Charting the Flow of Control We’ve used flow charts to visualise the flow of control. The simplest form is.
New Mexico Computer Science For All More Looping in NetLogo Maureen Psaila-Dombrowski.
Agenda Control Flow Statements Purpose test statement if / elif / else Statements for loops while vs. until statements case statement break vs. continue.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
CHAPTER SIX LOOPS © Prepared By: Razif Razali 1. FORMAT OR REFRESH!! WHAT HAVE WE LEARN? Differentiate between the types of selection structure? Which.
Chapter 7 Additional Control Structures. 2 2 void GetYesOrNo (/* out */ char& response) // Inputs a character from the user // Postcondition: response.
Chapter 5 Loops. Overview u Loop Statement Syntax  Loop Statement Structure: while, for, do-while u Count-Controlled Loops u Nested Loops u Loop Testing.
Chapter 8 Iteration Dept of Computer Engineering Khon Kaen University.
PROBLEM SOLVING WITH LOOPS Chapter 7. Concept of Repetition Structure Logic It is a computer task, that is used for Repeating a series of instructions.
ITEC113 Algorithms and Programming Techniques
Saeed Ghanbartehrani Summer 2015 Lecture Notes #5: Programming Structures IE 212: Computational Methods for Industrial Engineering.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 ‏ Control Structures.
Repetition Control Structures Simple Program Design Third Edition A Step-by-Step Approach 5.
Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Lecture 9 & 10 Repetition Statements.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
 Control Flow statements ◦ Selection statements ◦ Iteration statements ◦ Jump statements.
For…Next and Do...While Loops! Happy St. Patrick’s Day!
Controlling Program Flow with Looping Structures
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
LECTURE # 8 : REPETITION STATEMENTS By Mr. Ali Edan.
Unit – 3 Control structures. Condition Statements 1.If.…..else :- Has someone ever told you, "if you work hard, then you will succeed"? And what happens.
Dani Vainstein1 VBScript Session 5. Dani Vainstein2 What we learn last session? Branching Branching using If … Then … Else statement. Branching using.
Introduction to Programming G50PRO University of Nottingham Unit 6 : Control Flow Statements 2 Paul Tennent
Do-more Technical Training Instruction Set (Program-Looping)
Chapter 6 Controlling Program Flow with Looping Structures.
Do-more Technical Training Instruction Set (Program Control)
Loop. 3.1Introduction to Repetition Structures Loop – a block of code that, under certain conditions will be executed repeatedly. Do Prompt for and input.
CS 106 Introduction to Computer Science I 02 / 15 / 2008 Instructor: Michael Eckmann.
Infinite for Loop If you omit the test condition, the value is assumed to be TRUE so the loop will continue indefinitely unless you provide some other.
GoldSim Monthly Webinar Series. Goals  Learn the basics of simple scripts  Learn the basics of the GoldSim Script Element  Not a lesson on numerical.
Chapter 6: Loops.
REPETITION CONTROL STRUCTURE
Repetition Structures Chapter 9
Visual Basic 6 (VB6) Data Types, And Operators
Do-more Technical Training
PROGRAM CONTROL STRUCTURE
Branching Constructs Review
Review If you want to display a floating-point number in a particular format use The DecimalFormat Class printf A loop is… a control structure that causes.
Agenda Control Flow Statements Purpose test statement
The Linux Command Line Chapter 29
Conditinoal Constructs Review
Arrays, For loop While loop Do while loop
Looping and Repetition
For & do/while Loops.
Iteration: Beyond the Basic PERFORM
Iteration: Beyond the Basic PERFORM
Fundamentals of visual basic
FLUENCY WITH INFORMATION TECNOLOGY
Loops.
Introduction to Computer Science
Prepared By: Deborah Becker
Print the following triangle, using nested loops
ASP control structure BRANCHING STATEMENTS
Conditional Loops Counted Loops
Looping and Repetition
Introduction to Python
Presentation transcript:

Do-more Technical Training Instruction Set (Program-Looping)

Instruction Set (Program-Looping) Program-Looping (8) ▫BREAK ▫CONTINUE ▫FOR/NEXT ▫REPEAT/UNTIL ▫WHILE/WEND

Instruction Set (Program-Looping) BREAK “Exit Loop” ▫B▫Breaks out of FOR/NEXT, WHILE/WEND or REPEAT/UNTIL loop SSkips over instructions between BREAK and the NEXT, WEND, or UNTIL instruction NNo more iterations of the loop are done EExecution continues with instruction immediately following NEXT, WEND, or UNTIL SSkipping instruction FOR/NEXT loop iterates through range V100 = However, if any value is found in D that is negative, looping is stopped Finds maximum value in D Stores maximum value in D4010 D4010 (maximum value) is initialized to zero Maximum value is stored in D4010

Instruction Set (Program-Looping) CONTINUE “Skip to Loop End” ▫S▫Skips over instructions between CONTINUE and the NEXT, WEND, or UNTIL instruction SSimilar to BREAK except that the loop is not terminated EExecution continues with the next iteration of the loop next time the code block is scanned SSkipping instruction FOR/NEXT loop iterates through range V100 = However, if any value is found in D that is negative, looping is continued at next iteration Finds maximum value in D Stores maximum value in D4010 D4010 (maximum value) is initialized to zero Maximum value is stored in D4010

Instruction Set (Program-Looping) FOR “Index Loop” ▫D▫Designates the beginning of a loop in which instructions between FOR & NEXT are executed a predefined number of times NNo limit to nesting UUnconditional TTo make conditional place in Task and use ENTASK PParameters: IIndex – memory initialized to the From value and incremented by the By Step value FFrom – memory/constant that initializes Index TTo – memory/constant that designates the last loop value BBy Step – memory/constant by which Index is incremented by for each loop iteration NEXT “Index by Step” ▫D▫Designates the end of a FOR loop ▫Y▫Yielding instruction Finds the maximum value in the range of D

Instruction Set (Program-Looping) REPEAT “Loop Until Condition is Non-Zero” ▫D▫Designates the beginning of a loop in which instructions between REPEAT & UNTIL are executed until the ending Ending Condition is non-zero NNo limit to nesting UUnconditional TTo make conditional place in Task and use ENTASK UNTIL “Repeat Until Condition is Non-Zero” ▫D▫Designates the end of a REPEAT loop PParameters: EEnding Condition – memory location that if contains a non-zero value terminates the loop ▫Y▫Yielding instruction Ladder Code

Instruction Set (Program-Looping) WHILE “Loop While Condition is Non-Zero” ▫D▫Designates the beginning of a loop in which instructions between WHILE & WEND are executed while the Condition is non-zero SSimilar to REPEAT/UNTIL NNo limit to nesting UUnconditional TTo make conditional place in Task and use ENTASK WEND “While End” ▫D▫Designates the end of a WHILE loop ▫Y▫Yielding instruction Ladder Code