ARITHMETIC OPERATORS COMPARISON/RELATIO NAL OPERATORS LOGIC OPERATORS ()Parenthesis>Greater than &&And ^Exponentiation<Less than||Or *Multiplication >=>=

Slides:



Advertisements
Similar presentations
CS 101 Introductory Programming - Lecture 7: Loops In C & Good Coding Practices Presenter: Ankur Chattopadhyay.
Advertisements

Microsoft® Small Basic
CHAPTER 5: Repetition Control Structure. Objectives  To develop algorithms that use DOWHILE and REPEAT.. UNTIL structures  Introduce a pseudocode for.
Understanding the Three Basic Structures
Lesson 5 - Decision Structure By: Dan Lunney
CS0004: Introduction to Programming Repetition – Do Loops.
 Control structures  Algorithm & flowchart  If statements  While statements.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 4 – C Program Control Outline 4.1Introduction.
Chapter 6 - Repetition. Introduction u Many applications require certain operations to be carried out more than once. Such situations require repetition.
Switch structure Switch structure selects one from several alternatives depending on the value of the controlling expression. The controlling expression.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 4 - Program Control Outline 4.1Introduction 4.2The Essentials of Repetition 4.3Counter-Controlled.
Flow of Control Loops – Chapter 3.2. Java Loop Statements: Outline the while Statement the do-while Statement the for Statement.
Chapter 4 MATLAB Programming Logical Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Control Statements II.
Programming with MATLAB. Relational Operators The arithmetic operators has precedence over relational operators.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved The switch Multiple-Selection Statement switch.
C How to Program, 6/e Summary © by Pearson Education, Inc. All Rights Reserved.
 2000 Prentice Hall, Inc. All rights reserved. 1 Chapter 4 - Program Control Outline 4.1Introduction 4.2The Essentials of Repetition 4.3Counter-Controlled.
Lecture 10: Reviews. Control Structures All C programs written in term of 3 control structures Sequence structures Programs executed sequentially by default.
Engineering 1020 Introduction to Programming Peter King Winter 2010.
C Program Control Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010 Fall.
Lecture 8: Choosing the Correct Loop. do … while Repetition Statement Similar to the while statement Condition for repetition only tested after the body.
Logic Structure - focus on looping Please use speaker notes for additional information!
Control Structures Week Introduction -Representation of the theory and principles of structured programming. Demonstration of for, while,do…whil.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Flow Control (Switch, do-while, break) Outline 4.7The.
Programming Logic and Design Fifth Edition, Comprehensive
CSE 102 Introduction to Computer Engineering What is an Algorithm?
Loops 1. Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved while Loop Flow.
Visual Basic.net Loops. Used to do multiple executions of the same block of code Do while loops Do until loops For next loops.
Visual Basic Programming
ITEC113 Algorithms and Programming Techniques
Saeed Ghanbartehrani Summer 2015 Lecture Notes #5: Programming Structures IE 212: Computational Methods for Industrial Engineering.
Lecture 4: Calculating by Iterating. The while Repetition Statement Repetition structure Programmer specifies an action to be repeated while some condition.
MULTIPLE ALTERNATIVES IF… THEN… ELSEIF SELECT CASE.
Chapter 3 - Structured Program Development Outline 3.1Introduction 3.2Algorithms 3.3Pseudocode 3.4Control Structures 3.5The If Selection Structure 3.6The.
Basic Control Structures
 2008 Pearson Education, Inc. All rights reserved JavaScript: Control Statements I.
 2000 Prentice Hall, Inc. All rights reserved. 1 Chapter 4 - Program Control Outline 4.1Introduction 4.2The Essentials of Repetition 4.3Counter-Controlled.
1 Chapter 9. To familiarize you with  Simple PERFORM  How PERFORM statements are used for iteration  Options available with PERFORM 2.
ITERATIVE STATEMENTS. Definition Iterative statements (loops) allow a set of instruction to be executed or performed several until condition are met.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding the Three Basic Structures Structure: a basic unit of programming logic Any program.
Copyright © 2012 Pearson Education, Inc. Chapter 5: Loops.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
COMP Loop Statements Yi Hong May 21, 2015.
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.
Catie Welsh February 9,  Friday - No Lab! ◦ Bring questions on Project 2  Lab 3 due on Friday 2.
CC213 Programming Applications Week #2 2 Control Structures Control structures –control the flow of execution in a program or function. Three basic control.
Learning Javascript From Mr Saem
Chapter 4 Repetition Statements Program Development and Design Using C++, Third Edition.
Loops ( while and for ) CSE 1310 – Introduction to Computers and Programming Alexandra Stefan 1.
Chapter 4 – C Program Control
JavaScript: Control Statements I
Chapter 4 - Program Control
Ch 7: JavaScript Control Statements I.
JavaScript: Control Statements.
- Additional C Statements
Chapter 4 - Program Control
Understanding the Three Basic Structures
Iteration: Beyond the Basic PERFORM
Repetition Control Structure
Three Special Structures – Case, Do While, and Do Until
Loops.
2.6 The if/else Selection Structure
Dale Roberts, Lecturer IUPUI
Chapter 4 - Program Control
Presentation transcript:

ARITHMETIC OPERATORS COMPARISON/RELATIO NAL OPERATORS LOGIC OPERATORS ()Parenthesis>Greater than &&And ^Exponentiation<Less than||Or *Multiplication >=>= Greater than or equal to !Not /Division <=<= Less than or equal to +Addition= Equal -Subtraction!=!= Not equal

REVIEW Create a program that will determine if a number is positive or negative. Display the word positive or negative.

Given the weight of three persons, prepare a flowchart that determines and prints the heaviest weight. REVIEW

An instructor uses the grading scheme below to award the letter grades in an examination. Given your numeric grade as an input, prepare a flowchart that will print the letter grade equivalent A 80-89B C F >100 AND <65 “OUT OF RANGE”

ITERATION CONTROL STRUCTURE

-IS A STRUCTURE IN WHICH A PROCESS MAY BE REPEATED AS LONG AS A CERTAIN CONDITION REMAINS TRUE OR REMAINS FALSE. -CONTROL STRUCTURE USED FOR SPECIFYING THE REPEATED EXECUTION OF A SERIES OF STEPS.

Loop Statement(s) Do until test condition NO YES DO UNTIL STRUCTURE Do until test condition YES NO DO WHILE STRUCTURE Loop Statement(s)

IN THE DO-UNTIL STRUCTURE, EXIT FROM THE LOOP IS DONE AT THE END OF THE LOOP. ALSO, THE LOOP STATEMENTS ARE EXECUTED AT LAST ONCE BECAUSE THEY ARE PERFORMED BEFORE THE PROGRAM CHECKS WHETEHER TO STOP OR NOT. IN THE DO-WHILE STRUCTURE, THE LOOP-EXIT CONDITION IS PLACED AT THE BEGINNING OF THE LOOP. DEFINITION

Sample Problems: 1)Create a flowchart that will print the word “LSQC” for 10 times. 2)Prepare a flowchart that will generate nos. from 1 to 3. And will print all the nos. 3) Prepare a flowchart that will generate nos. from 3 to 1. And will print all the nos.

ACTIVITY CREATE A FLOWCHART THAT WILL GENERATE NOS. FROM -3 TO 3 AND WILL PRINT ALL THE POSITIVE NOS. CREATE A FLOWCHART THAT WILL GENERATE NOS. FROM 1 TO 3 AND WILL PRINT THE LAST NUMBER.