EEE 243B Applied Computer Programming 11 - Flowcharts §Appendix C Sylvain P. Leblanc.

Slides:



Advertisements
Similar presentations
Algorithms An algorithm is a finite sequence of instructions, logic, an explicit step-by-step procedure for solving a problem. Specific algorithms sometimes.
Advertisements

PROBLEM SOLVING TECHNIQUES
How Are Algorithms Developed?
1.4 Programming Tools Flowcharts Pseudocode Hierarchy Chart
Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering
Chapter 2 - Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2 - Problem Solving
Fundamentals of Algorithms MCS - 2 Lecture # 4
ITEC113 Algorithms and Programming Techniques
Chapter 2- Visual Basic Schneider
CS 201 Functions Debzani Deb.
CS 201 Functions Debzani Deb.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering.
Problem Solving Chapter 2. What is an algorithm? n A solution to a problem that is: –Precise –Effective –Terminating.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
The Program Design Phases
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering.
Programming Logic and System Analysis
Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 5 Structured Program.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Introduction to Computer Programming Using C Session 23 - Review.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Lecture 5: Developing Procedural Thinking (How to think like a programmer) B Burlingame 30 Sept 2015.
Chapter 5 Algorithms Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information Technology.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Lecture 2: Logical Problems with Choices. Problem Solving Before writing a program Have a thorough understanding of the problem Carefully plan an approach.
PSEUDOCODE C Programming Technique – Firdaus-Harun.com.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering Problem Solving and Logic.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Structured Programming (4 Credits)
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Expressing Algorithms as Flowcharts and Pseudocode
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
 Problem Analysis  Coding  Debugging  Testing.
Chapter One Problem Solving
Programming Languages
Chapter One Problem Solving
Be A programmer in Steps
Chapter 2- Visual Basic Schneider
ALGORITHMS AND FLOWCHARTS
System Design.
Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.
Algorithm Algorithm is a step-by-step procedure or formula or set of instruction for solving a problem Its written in English language or natural language.
Programming Logic n Techniques
Programming Fundamentals
Unit# 9: Computer Program Development
Computer Programming LAB 1 Tejalal Choudhary Asst. Prof, CSE Dept.
How to develop a program?
Structured Program
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
How Are Algorithms Developed?
ICT Gaming Lesson 2.
Basic Concepts of Algorithm
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Top-Down Design with Functions
Programming Logic and Design Eighth Edition
Structural Program Development: If, If-Else
Presentation transcript:

EEE 243B Applied Computer Programming 11 - Flowcharts §Appendix C Sylvain P. Leblanc

Review What are the three ways to use the name of a function in a program? Are identifiers required for the parameters in a function prototype? Can you use a void function in an assignment expression? Why/Why not What information does the type of a variable give us? Winter Prof S.P. Leblanc

Outline 1.Representing Program Behaviour 2.Flowchart Evolution and Motivation 3.Flowchart Symbols a.Auxiliary b.Primary 4.Flow Control Flowcharts a. if-else b. switch c. for d. while e. do…while 5.Flowcharts and EEE243 3 Winter 2011Prof S.P. Leblanc

1.Representing Program Behaviour In the lectures 08 and 09, we have seen flow of control structures: functions, if-else, else- if, switch, while, for and do-while There are several methods to represent the logic behind the use of these constructs Pseudo code – English like statements Flowcharts – Graphical Chapin diagrams – Graphical Winter Prof S.P. Leblanc

Flowcharts vs. Structure Charts The Structure Charts that we discussed with functions are also a graphical method, but they are different: Structure Charts describe the hierarchical organization Flow Charts describe the behaviour In Flowcharts, each of the flow control constructs can be graphically represented Regardless if you use OOAD or structured programming, flowcharts can help you visualize the logic flow of a program 5 Winter 2011Prof S.P. Leblanc

2.Flowchart Evolution Flowcharts used to be the main design tool for symbolic languages to represent the logic flow of a program Flowcharts fell out of grace when new analysis and design techniques emerged Flowcharts were seen as not scalable for large scale designs Before diagrammatic tools, flowcharts were drawn by hand using stencils 6 Winter 2011Prof S.P. Leblanc

2. Flowchart Evolution The production of these charts was tedious, and for large monolithic programs, they were difficult to manage For large programs it used to be common to see “wall flowcharts” So why do we still use them? Our programs are no longer huge monolithic lines of assembler code We decompose our problems into manageable parts (functions) 7 Winter 2011Prof S.P. Leblanc

2.Flowcharts Motivation Flowcharts are now used to describe the inside of functions; not the entire program A flowchart shows an algorithm – a way to solve a problem The flowchart frees the programmer from the syntax and details of the programming language and allows him to concentrate on the details of the problem to be solved A pictorial representation of our programs allows us to think more clearly There are several software tools that you can use to draw flowcharts. PowerPoint was used for all these charts Visio also has this capability Winter Prof S.P. Leblanc

3a.Flowcharts – Auxiliary Symbols We will not cover all the symbols here, we covered the main symbols that you will need to produce algorithms Terminal symbol – shows start and end of algorithms Flow lines – Shows the order of actions Connector – Shows connecting points in algorithm: When we reach the end of a page or column, When we want to show something that does not fit in the flow Winter Prof S.P. Leblanc Start n

3b.Flowcharts – Primary Symbols Assignment Statements I/O Statements Call to a function in another module Compound Statement Winter Prof S.P. Leblanc sum = a + b mult = a * b READ (a) x  abs() from math.h

4aFlowcharts – if-else Winter Prof S.P. Leblanc a > 10 Something else TF

4aFlowcharts – switch Winter Prof S.P. Leblanc a ? Something m Something 0 Something n mno

4.Flowcharts - for Winter Prof S.P. Leblanc Initial condition Condition Update Something T F

4.Flowcharts – while Winter Prof S.P. Leblanc Condition Something T F

4.Flowcharts – do…while Winter Prof S.P. Leblanc T F Something Condition

5.Flowcharts in EEE243 Note that you will be required to create a flowchart to hand in for one of your labs I recommend flowcharting to capture solution you develop when faced with a problem Step 4 in the structured design procedure we covered in lecture 04 Flowcharts are at the same conceptual level a C code But flowcharts make it easier to see the algorithm.. It represents a different abstraction Most student’s generate their flow chart afterwards instead of using it as a design tool That’s a mistake! Practice with flow charting, and complex problems will become easier to solve. Winter Prof S.P. Leblanc

Quiz Time Why are flow charts useful? Winter Prof S.P. Leblanc

Next Lecture Arrays and Command Line Arguments 18 Winter 2011Prof S.P. Leblanc