Control Structure There are two kind of control structure in GWBASIC one is iteration/loop or repetitive and second make decision/condition. Iteration/Loop.

Slides:



Advertisements
Similar presentations
Control Structures.
Advertisements

Fill in missing numbers or operations
Ozone Level ppb (parts per billion)
Graphing Linear Inequalities in Two Variables
Repetition Statements Perform the same task repeatedly Allow the computer to do the tedious, boring things.
1 1  1 =.
1  1 =.
Science Jeopardy >>>> Topic 1 Topic 2 Topic 4 Topic Topic 5.
Dependency Test in Loops By Amala Gandhi. Data Dependence Three types of data dependence: 1. Flow (True) dependence : read-after-write int a, b, c; a.
Money Math Review.
Chapter 7 - Iteration. Chapter Goals Program repitiation statements – or loops – with the for, while, and do-while statements Program repitiation statements.
Control Flow Statements: Repetition/Looping
Pemrograman Dasar Control Flow Statements: Decision Making or Selection PTIIK - UB 1.
Programming In C++ Spring Semester 2013 Lecture 3 Programming In C++, Lecture 3 By Umer Rana.
Side by Side Task Task 1Task 2Task 3Task 4 Task 5Task 6Task 7Task 8 Task 9Task 10 NC Level 4 to 7.
UNIT 2: SOLVING EQUATIONS AND INEQUALITIES SOLVE EACH OF THE FOLLOWING EQUATIONS FOR y. # x + 5 y = x 5 y = 2 x y = 2 x y.
Computer Science 101 While Statement. Iteration: The While-Statement The syntax for the While- Statement is while : The syntax for the While- Statement.
CS 101 Introductory Programming - Lecture 7: Loops In C & Good Coding Practices Presenter: Ankur Chattopadhyay.
MathOnMonday® Presents: Building Math Courage® A program designed for Adults or Kids who have struggled to learn their Math in the traditional classroom!
Number bonds to 10,
Lecture 3: Control Structures - Selection BJ Furman 10SEP2012.
Jeopardy Start Final Jeopardy Question Category 1Category 2Category 3Category 4Category
Back to menu category 1 type you categories here– delete these instructions. Final jeopardy question.
Powerpoint Jeopardy Category 1Category 2Category 3Category 4Category
Let’s Add! Click the cloud below for a secret question! Get Started!
The second kind of control structure in GWBASIC is condition or decision making. In GWBASIC we use If.. Then.. Else statement. 2 ) If.. Then …Else The.
Chapter 3 Flow of Control Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
A loop is a repetition control structure. it causes a single statement or block to be executed repeatedly What is a loop?
CS100J October 07, 2003 Loops Repetitive statements, or iterative statements, or loops “O! Thou hast damnable iteration and art, indeed, able to corrupt.
Loops – While, Do, For Repetition Statements Introduction to Arrays
CHAPTER 6 REPETITIVE EXECUTION 6.1 Introduction A repetition structure or loop makes possible the repeated execution of one or more statements called the.
Repetition Structures: For Loop Constants CSC 1401: Introduction to Programming with Java Week 5 Wanda M. Kunkle.
CSE 113 Week 5 February , Announcements  Module 2 due 2/15  Exam 3 is on 2/15  Module 3 due 2/22  Exam 4 is on 2/25  Module 4 due 2/29.
Loops Repetition Statements. Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional.
© 2004 Pearson Addison-Wesley. All rights reserved5-1 Iterations/ Loops The while Statement Other Repetition Statements.
Copyright © Texas Education Agency, Computer Programming For Loops.
New Mexico Computer Science For All More Looping in NetLogo Maureen Psaila-Dombrowski.
CPS120 Introduction to Computer Science Iteration (Looping)
Repetition Statements.  Often it is necessary to repeat statements many times  Java has two ways of doing this  while statements  for statements.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
For loops in programming Assumes you have seen assignment statements and print statements.
Lecture 4: Calculating by Iterating. The while Repetition Statement Repetition structure Programmer specifies an action to be repeated while some condition.
L OO P S While writing a program, there may be a situation when you need to perform some action over and over again. In such situation you would need.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
CPS120 Introduction to Computer Science Iteration (Looping)
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
CSD 340 (Blum)1 For Loops See Beginning JavaScript (Paul Wilton) p. 87.
Fourth Quarter.  Involves loops or cycles ◦ Loops: means that a process may be repeated as long as certain condition remains true or remains false. ◦
Why Repetition? Read 8 real numbers and compute their average REAL X1, X2, X3, X4, X5, X6, X7, X8 REAL SUM, AVG READ *, X1, X2, X3, X4, X5, X6, X7, X8.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Conditional Statements A conditional statement lets us choose which statement will be executed next Conditional statements give us the power to make basic.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
Topic : While, For, Do-While Loop Guided By : Branch : Batch :
Chapter 9 Repetition.
CiS 260: App Dev I Chapter 4: Control Structures II.
ITM 352 Flow-Control: Loops
Chapter 5 Repetition.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Outline Altering flow of control Boolean expressions
Laptop Instrument Meeting 7 February 7, 2018.
Chapter (3) - Looping Questions.
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
For Loops (Iteration 1) Programming Guides.
A LESSON IN LOOPING What is a loop?
FLUENCY WITH INFORMATION TECNOLOGY
PROGRAM FLOWCHART Iteration Statements.
Statements in C Programming
REPETITION Why Repetition?
Presentation transcript:

Control Structure There are two kind of control structure in GWBASIC one is iteration/loop or repetitive and second make decision/condition. Iteration/Loop The Loop mean one or more statements execute many times is called Loop. Here control transfer always upward. There are two types of loops. For … Next While .. Wend

Control Structure For .. Next The for next loop allows programs to repeat a statement or statements, as long as a certain is number of times. Syntax For Variable = Start No. To Stop No. [ Step Increment No.] statement1 statement2 .. Next

Control Structure While .. Wend The while loop allows programs to repeat a statement or series of statement, over and over, as long as a certain test condition is true. Syntax While test statement1 statement2 .. Wend

Practical #15 Write a program to calculate current value at five different resistance values are from 1 to 5 here constant voltage is 5 by using loops. Formula is I=V/R.

15 print “Current = Voltage / resistance “ 20 for r = 1 to 5 10 Key Off 15 print “Current = Voltage / resistance “ 20 for r = 1 to 5 30 let v=5 Let I = v / r 50 print I ; “=“ ; v ; “/” ; r 60 next 70 end Out Put 10 CLS 20 Print “Current = Voltage / resistance “ 30 r=1 40 While r <= 5 50 let v=5 60 Let I = v / r 70 Print I ; “=“ ; v ; “/” ; r 80 r=r+1 90 Wend 100 End

Out Put Current Voltage Resistance =================================== 5 5 1 2.5 5 2 1.66667 5 3 1.25 5 4 1 5 5