Program Flow CSCE 121 J. Michael Moore.

Slides:



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

How SAS implements structured programming constructs
Control Structures Ranga Rodrigo. Control Structures in Brief C++ or JavaEiffel if-elseif-elseif-else-end caseinspect for, while, do-whilefrom-until-loop-end.
Unit 6 Assignment 2 Chris Boardley.
1 ILP (Recap). 2 Basic Block (BB) ILP is quite small –BB: a straight-line code sequence with no branches in except to the entry and no branches out except.
Chapter 10 Code Optimization. A main goal is to achieve a better performance Front End Code Gen Intermediate Code source Code target Code user Machine-
Dependency Analysis We want to “parallelize” program to make it run faster. For that, we need dependence analysis to ensure correctness.
3.1.3 Program Flow control_1 Understand the need for structure Breaking things down.
An Object-Oriented Approach to Programming Logic and Design
1 Statement-Level Control Structures Levels of flow control Control Statements 1. Sequence 2. Selection 3. Iteration Unconditional branching Guarded commands.
1. Know the different types of flow block 2. Understand how problems can be broken down into smaller problems.
Definition of Terms Software/Programs Programs that directs the operation of a computer system Set of instructions Codes Programming Process of planning,
Introduction to Flow Chart It is pictorial representation of process of a system or processes. Types of Flow charts –Program Flow Chart –System Flow chart.
Debuggers in Python. The Debugger Every programming IDE has a tool called a debugger. This application does NOT locate or fix your bugs for you! It slows.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Structured Programming The Basics. Control structures They control the order of execution What order statements will be done in, or whether they will.
CSI 3125, Preliminaries, page 1 Control Statements.
Chapter 7: Repetition Structure (Loop) Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills.
P ROGRAMMING L OGIC GWDA123 Sharon Kaitner, M.Ed. Winter 2015: Week 2.
Fourth Quarter.  Involves loops or cycles ◦ Loops: means that a process may be repeated as long as certain condition remains true or remains false. ◦
Polya’s 4-step Process 1.Understand the problem 2.Devise a plan 3.Carry out the plan 4.Look back, review results.
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.
Control Structure  What is control Structure?  Types of Controls  Use the control structure in VBScript.  Example Summery.
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.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
Structured Programming The Basics
Code Optimization Overview and Examples
Fundamentals of PL/SQL part 2 (Basics)
Chapter 6: Loops.
Chapter 4 Repetition Statements (loops)
Flowchart Symbols Terminal Process Input/ Output Decision
Introduction to programming
Tutorial 12 Working with Arrays, Loops, and Conditional Statements
PROGRAM CONTROL STRUCTURE
Think What will be the output?
Chapter 5: Repetition Structures
Ch 7: JavaScript Control Statements I.
Web Programming– UFCFB Lecture 16
Beginning C Lecture 4 Lecturer: Dr. Zhao Qinpei
Iterations Programming Condition Controlled Loops (WHILE Loop)
Iteration CSCE 121 J. Michael Moore.
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
FLOW OF CONTROL.
Software Development Process
Sorting CSCE 121 J. Michael Moore
Programming Problem solving Debugging
Control Flow Analysis CS 4501 Baishakhi Ray.
Selection CSCE 121 J. Michael Moore.
Chapter 6: Repetition Structures
Chapter 5: Repetition Structures
Functions Overview CSCE 121 J. Michael Moore
Debugging CSCE 121 J. Michael Moore.
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Structured Programming Taken from notes by Dr. Neil Moore
Coding Constructs considered Violations of Structured Programming
Iteration Implemented through loop constructs (e.g., in C++)
Code Optimization Overview and Examples Control Flow Graph
Computer Science Core Concepts
ICT Programming Lesson 3:
Intro to Computer Science Loops
Program Flow.
ICT Programming Lesson 5:
Structured Programming
Chapter 4: Repetition Structures: Looping
PROGRAM FLOWCHART Iteration Statements.
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
statement. Another decision statement, , creates branches for multi-
Introduction to Python
Presentation transcript:

Program Flow CSCE 121 J. Michael Moore

Structured Programming Programmers used to use ‘goto’ a lot. This is universally considered BAD PRACTICE. This resulted in “Spaghetti code” that was hard to follow / understand / debug. Structured programming saw all programs as composed of three control structures. While not the only programming paradigm, aspects of structured programming still apply today.

Control Structures Sequence Selection Iteration

Sequence Selection Iteration Control Structures The ordering of statements Can include function calls Essentially no “Decisions” are made.

Sequence Selection Iteration Control Structures Also called branching Allows a block of code to be executed or not based on a “Decision/Question” Allows for different paths through the code

Sequence Selection Iteration Control Structures Also called looping Allows a block of code to be run repeatedly until a condition is satisfied