Flowcharts.

Slides:



Advertisements
Similar presentations
CS 240 Computer Programming 1
Advertisements

CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
CS107 Introduction to Computer Science Lecture 2.
CS107: Introduction to Computer Science Lecture 2 Jan 29th.
Introduction to Flowcharting
Introduction to Flowcharting
Flow Control Analysis & Design Tool: Flowcharts
Creating Flowcharts Principles Of Engineering
Flowchart What is a flowchart? A flowchart is a schematic representation of an algorithm or a process or a program. Why should a flowchart be produce before.
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
CS 240 Computer Programming 1
Chapter 1 Pseudocode & Flowcharts
 Control structures  Algorithm & flowchart  If statements  While statements.
Flow Chart.
ITEC113 Algorithms and Programming Techniques
Chapter 2- Visual Basic Schneider
Developing logic (Examples on algorithm and flowchart)
Chapter 3 Planning Your Solution
The Program Design Phases
Review Algorithm Analysis Problem Solving Space Complexity
(C)opyright 2003 Scott/Jones Publishers Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Scott/Jones Publishers.
Algorithm & Flowchart.
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
CSC103: Introduction to Computer and Programming
DCT 1123 Problem Solving & Algorithms
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Flow Charting. Goals Create Algorithms using Flow Charting procedures. Distinguish between Flow Charting and Pseudocode. Top-Down Design Bottom-up Design.
Chapter 2 - Algorithms and Design
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
CSEB114: Principle of programming
CSE 102 Introduction to Computer Engineering What is an Algorithm?
Software Life Cycle What Requirements Gathering, Problem definition
ENGR-25_Programming-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Registered Electrical.
Value and Reference Parameters. CSCE 1062 Outline  Summary of value parameters  Summary of reference parameters  Argument/Parameter list correspondence.
Visual Basic Programming
ALGORITHM List of instructions for carrying out some process step by step. A sequence of instructions which has a clear meaning and can performed with.
CHAPTER 1 INTRODUCTION 1 st semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Chapter 1 Pseudocode & Flowcharts
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process.
(C)opyright 2000 Scott/Jones Publishers Introduction to Flowcharting.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
FLOWCHARTING AND ALGORITHMS
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
Learning Objective To be able to… Understand flow chart symbols Complete and correct flow chart algorithms Create a program based on a flow chart.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Problem Solving Flowcharts. Flowcharts Introduction  Flowcharts allow us to create a visual representation of a solution to a problem DRAW  With flowcharts,
CSE 110: Programming Language I Matin Saad Abdullah UB 404.
Introduction to Programming / chapter 3 / COM1022
Introduction to Flowcharting
Be A programmer in Steps
PROGRAM CONTROL STRUCTURE
Computer Programming Flowchart.
Introduction to Flowcharting
ALGORITHMS AND FLOWCHARTS
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
Chapter 2- Visual Basic Schneider
Chapter 1 Pseudocode & Flowcharts
Chapter 2- Visual Basic Schneider
ME 142 Engineering Computation I
Flowcharts and Pseudo Code
Basic Concepts of Algorithm
Chapter 1 Pseudocode & Flowcharts
Introduction to Programming
Introduction to Flowcharts
Presentation transcript:

Flowcharts

Problem Solving using computers Problem Solving using computers. Flowcharts: A language for expressing ‘Algorithms’

Flowcharts A pictorial representation of algorithms; Flowcharts are not a programming language, rather it is an algorithm specification language; In an algorithm we specify the computation operations (arithmetic, logical, data input, data output) to be done, and their sequence; Each type of computation operation is denoted by a special symbol in the flowchart language; Symbols are connected by arrows to represent the order of the operations (sequence); Flowchart are useful during algorithm design; A flowchart can be relatively easily translated to a C++ program.

Flowcharts Symbols Calculation (square or rectangle) You use it to specify a calculation, e.g. arithmetic expression. Examples: x = z+y; a = pi * r*r; z = z + 1 (add one to the current value of z and make that the new value of z); c = SQRT(x*x+y*y); x, z, y, a, c, pi, r are called variables. z = z +1 c = SQRT(x*x +y*y)

Flowcharts Symbols Data Input/Output (parallelogram) Use it to specify an input or an output operation; By an input operation we mean a read operation of data from a peripheral device to Main Memory (e.g. user typing on a keyboard ); By an output operation we mean a write operation of data to a peripheral device from Main Memory (e.g. data displayed on the monitor, or sent to the printer); Examples: Read a value for the radius r from the keyboard; print value of the area a on the screen. input a print a

Flowcharts Symbols Decision or condition Testing (Diamond) Use it to specify a condition to be tested. Based on the condition being true or false the next operation will be determined. Examples If (Adjusted Gross Income) > 40000 then taxRate = 0.31 else taxRate = 0.28 or if(r < 0 ) then print “invalid value for the radius” continue. no AGI>40000 ? TR = 0.28 yes TR = 0.31 You do it as an exercise

Flowcharts Symbols Decision or condition Testing cnt’d A decision is composed of : A condition; An operation to be done if condition is true; An operation to be done if condition is false; We use decisions to enable repeating a set of operations multiple times; we call this construct a loop. An example of a loop is let sum = 0; do { input a; sum = sum+a; } until (a <0); sum = 0 input a sum = sum +a no a < 0 ? yes

Flowcharts Symbols Start/End Every algorithm starts somewhere, and terminates somewhere; Every flowchart must have one start symbol and one or more end symbols; A start symbol denotes the start of the algorithm; When an end symbol is encountered this indicates the algorithm has terminated. start sum = 0 input a sum = sum +a a < 0 ? no yes print sum stop

Flowcharts Exercise Let’s Develop the flow chart for the algorithm that computes the circumference of a circle whose radius r is given as input. Don’t forget to check if the radius is positive number! Fig.2