FLOW CHART AND PSEUDO CODE

Similar documents
depicts pictorially schematic representation of an algorithm document algorithms. used in designing or documenting

ALGORITHMS AND FLOWCHARTS

Software Development. Designing Software

PROBLEM SOLVING AND OFFICE AUTOMATION. A Program consists of a series of instruction that a computer processes to perform the required operation.

Unit II. (i) Computer Programming Languages

IDENTIFY WAYS OF REPRESENTING ALGORITHMS.

FLOWCHARTS A flowchart is a graphical representation of the steps to be followed for solving problem. It consists of a set of symbols.

بسم اهلل الرمحن الرحيم

Chapter Two: Program Design Process and Logic

PROBLEM SOLVING AND PYTHON PROGRAMMING

Computer System and programming in C

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING

Introduction to Flowcharting

Class 8 ALGORITHMS AND FLOWCHARTS. The City School

PROGRAM DESIGN TOOLS. Algorithms, Flow Charts, Pseudo codes and Decision Tables. Designed by Parul Khurana, LIECA.

Computer Fundamentals: Pradeep K. Sinha & Priti Sinha

CS 199 Computer Programming. Spring 2018 Lecture 2 Problem Solving

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

CSC 121 Spring 2017 Howard Rosenthal

CS111: PROGRAMMING LANGUAGE1. Lecture 2: Algorithmic Problem Solving

PSEUDOCODE AND FLOWCHARTS. Introduction to Programming

Engineering program development. Edited by Péter Vass

Steps to program development

Notes By: Shailesh Bdr. Pandey, TA, Computer Engineering Department, Nepal Engineering College

Introduction to Computer Programming/Handout 01 Page 1 of 13

Pseudo Code and Flow Charts. Chapter 1 Lesson 2

Chapter 1: Problem Solving Skills Introduction to Programming GENG 200

The sequence of steps to be performed in order to solve a problem by the computer is known as an algorithm.

FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING UNIT III. 2 Marks PROBLEM SOLVING AND OFFICE AUTOMATION

Visual Basic Course Pack

UNIT-3 PROBLEM SOLVING AND OFFICE AUTOMATION

Individual research task. You should all have completed the research task set last week. Please make sure you hand it in today.

SNS COLLEGE OF ENGINEERING,

Method & Tools for Program Analysis & Design

ENT 189: COMPUTER PROGRAMMING. H/P: Home page:

UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS

SOFTWARE ANALYSIS & DESIGN TOOLS

Fundamental of Programming (C)

Fundamentals of Programming

BIL101E: Introduction to Computers and Information systems Lecture 8

Detailed Contents. 1. Introduction to Computers Input and Output Devices 14


C++ Programming Language Lecture 2 Problem Analysis and Solution Representation

CHAPTER 2 PROBLEM SOLVING TECHNIQUES. Mr Mohd Hatta Bin Hj Mohamed Ali Computer Programming BFC2042

Computers Programming Course 6. Iulian Năstac

Outline. Program development cycle. Algorithms development and representation. Examples.

Final Examination Semester 2 / Year 2010

1. The first step that programmers follow when they solve problems is to plan the algorithm.

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1

Problem Solving FLOWCHART. by Noor Azida Binti Sahabudin Faculty of Computer Systems & Software Engineering

TABLE OF CONTENTS 2 CHAPTER 1 3 CHAPTER 2 4 CHAPTER 3. Algorithm Design & Problem Solving. Programming. Databases

Chapter 1: An Overview of Computers and Logic

Programming Logic Beginning

Programming Logic - Beginning

An Introduction to Programming with C++ Sixth Edition. Chapter 7 The Repetition Structure

Working with Health IT Systems is available under a Creative Commons Attribution-NonCommercial- ShareAlike 3.0 Unported license.

4. The is a diagram that graphically depicts the steps that take place in a program. a. Program b. Flowchart c. Algorithm d. Code e.

Basic Flowchart Symbols and Meaning

Chapter 2: Input, Processing, and Output

Slide 1 Welcome to Fundamentals of Health Workflow Process Analysis and Redesign: Process Mapping: Gane-Sarson Notation. This is Lecture d.

Problem Solving with Decisions. T.Fatin Alhila

Week 1 Introduction to Programming

At the top of the every document that you create (word processing or source files) include:

SNS COLLEGE OF ENGINEERING

Understanding the problem

ENG 101 Lesson -21. neater and more readable flowchart is needed, the latter

Fundamentals of Programming. Lecture 6: Structured Development (part one)

Bachelor of Computer Application INTRODUCTION TO COMPUTER PROGRAMMING USING C. Block-1


Chapter 3 Structured Program Development

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Flow Chart & Algorithms

Introduction Objectives: 1) differentiate between high-level, low-level, and machine language; 2) explain why it is necessary to translate a program

SOEE1160: Computers and Programming in Geosciences Semester /08. Dr. Sebastian Rost

COP 2000 Introduction to Computer Programming Mid-Term Exam Review

Computers and FORTRAN Language Fortran 95/2003. Dr. Isaac Gang Tuesday March 1, 2011 Lecture 3 notes. Topics:

Computer Programming-I. Developed by: Strawberry

Programming revision. Revision tip: Focus on the things you find difficult first.

Chapter 2 - Problem Solving

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

Fundamentals of Health Workflow Process Analysis and Redesign

Structured Program Development in C

CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vidyanagar

Loops! Loops! Loops! Lecture 5 COP 3014 Fall September 25, 2017

K Hinds Section No.2 Problem-Solving and Program Design12

Flow Chart. The diagrammatic representation shows a solution to a given problem.

Com S 127x - Lab 6 1. READING FLOWCHARTS WITH CONDITIONAL ACTIONS!

Welcome to Starting Out with Programming Logic and Design, Third Edition.

DEPARTMENT OF INFORMATION TECHNOLOGY

Module 5. Function-Oriented Software Design. Version 2 CSE IIT, Kharagpur

Stepwise Refinement. Lecture 12 COP 3014 Spring February 2, 2017

(I m not printing out these notes! Take your own.)

Programmable Control. Name Class Teacher. Ellon Academy Technical Faculty

5 The Control Structure Diagram (CSD)

Pseudocode. ARITHMETIC OPERATORS: In pseudocode arithmetic operators are used to perform arithmetic operations. These operators are listed below:

1. The narratives, diagrams, charts, and other written materials that explain how a system works are collectively called

LECTURE 5 Control Structures Part 2

Review. Input, Processing and Output. Review. Review. Designing a Program. Typical Software Development cycle. Bonita Sharif

Ms. Payne, WCSS. This is very much like asking a question, and having a yes/no answer (also known a true/false). The general structure for this is:

Transcription:

FLOW CHART AND PSEUDO CODE

Flowchart A Flowchart is a pictorial representation of an algorithm. The First flowchart is made by John Von Newman in 1945. It is a symbolic diagram of operation sequence, dataflow, control flow and processing logic in information processing. The symbol used are simple and easy to learn. It is a very help full tool for programmers and beginners.

The Flowchart (Dictionary) A schematic representation of a sequence of operations, as in a manufacturing process or computer program. (Technical) A graphical representation of the sequence of operations in an information system or program. Information system flowcharts show how data flows from source documents through the computer to final distribution to users. Program flowcharts show the sequence of instructions in a single program or subroutine. Different symbols are used to draw each type of flowchart.

The Flowchart A Flowchart shows logic of an algorithm emphasizes individual steps and their interconnections e.g. control flow from one action to the next

Purpose of flowchart Provide Communication. Provide an overview. Show all elements and its relationship. Quick method of showing program flow. Check program logic. Facilitate coding. Provide program revision. Provide Program documentation.

FLOWCHART A flow chart is a graphical or symbolic representation of a process. They are basically used to design and document complex processes to help the viewers to visualize the logic of the process so that they can gain a better understanding of the process and find flaws, bottlenecks, and other less-obvious features within it. Start and end symbols also known as the terminal symbol is always the first and the last symbol in a flowchart. Generic processing step also called an activity is represents instructions like add a to b, save the result. Input/ Output symbols are represented as a parallelogram and are used to get input from users or display the results to them. A Conditional or decision symbol is used to depict a Yes/No question or True/False test. Labeled connectors represented by an identifying label inside a circle are used in complex or multi-sheet diagrams to substitute for arrows.

Symbols used in flowchart All symbols are of different shape and size. All have specific meaning and use. The ANSI ( American National Standard Institute) group categories symbols in 3 types basic, specialized and additional symbols. These institution and standardized these basic symbols for use.

BASIC SYMBOLS Terminal Symbol = for start and stop. INPUT and OUTPUT = Any function of input and output data. Processing = An arithmetic and data movement instruction. Shows mathematical calculation and logic operations.

SYMBOLS Decision = Diamond indicate decision point in the program flow. IT may have 2 way branch or 3 way also. Flow Lines = A Straight line between two boxes shows the path of logic flow in the program. An arrow head on the top of the line shows the direction of the flow, data from top to bottom and left to right. Connectors = 2 small circles are used to connect separated portions of a flowchart without drawing lines between the parts. One connector indicated where the flow breaks off the other where it resumes.

Flowchart Symbols Basic

Flowcharts for three constructs

Advantages of flowchart. Communication. Effective analysis. Proper documentation. Efficient coding. Proper debugging. Efficient program maintenance. Easy and clear presentation.

Advantages of Flowcharts A flowchart is a diagrammatic representation that illustrates the sequence of steps that must be performed to solve a problem. They are usually drawn in the early stages of formulating computer solutions to facilitate communication between programmers and business people. Flowcharts help programmers to understand the logic of complicated and lengthy problems. They help to analyze the problem in a more effective manner Flowchart is also used for program documentation. Flowchart can be used to debug programs that have error(s).

Limitation of flowchart Complex logic. Drawing is time consuming. Alteration and modification. Redrawn many times. Difficult to draw and remember. Reproduction ( replica ). Technical detail.

Limitations of using Flowcharts Drawing flowcharts is a laborious and a time consuming activity. Flowchart of a complex program becomes, complex and clumsy. At times, a little bit of alteration in the solution may require complete re-drawing of the flowchart Essentials of what is done may get lost in the technical details of how it is done. There are no well defined standards that limits the details that must be incorporated in a flowchart

PSEUDOCODE It is a form of structured English that describes algorithms. It facilitates the designers to focus on the logic of the algorithm without getting bogged down by the details of language syntax. Pseudocode is a compact and informal high-level description of an algorithm that uses the structural conventions of a programming language. It is meant for human reading rather than machine reading, so it omits the details that are not essential for humans. Such details include keywords, variable declarations, system-specific code and subroutines. It is commonly used in textbooks and scientific publications for documenting algorithms, and for sketching out the program structure before the actual coding is done. This would help even the non-programmers to understand the logic of the designed solution. There are no standards defined for writing a pseudocode because a pseudocode is not an executable program. Flowcharts can be considered as a graphical alternative to pseudocode, but are more spacious on paper.

Pseudo code First produce a general algorithm (one can use pseudo code) Refine the algorithm successively to get step by step detailed algorithm that is very close to a computer language. Pseudo code is an artificial and informal language that helps programmers develop algorithms. Pseudo code is very similar to everyday English.

Pseudocode Pseudocode is an informal description of an algorithm English-like statements that require less precision than a formal programming language. Allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax. A good pseudocode algorithm should be independent of, but easily translated into, any formal programming language.

Pseudocode Control Structures Sequence control structures Instructions are performed linearly Conditional control structures A choice/selection is made between multiple courses of action Looping/iteration control structures Enables repeating instructions within the algorithm A test condition determines when the repetition ends

Pseudocode Control Structures Selection and conditional 1. if (condition) then 2. statement 1 3.... 4. endif If the (condition) is TRUE then statements between THEN and ENDIF are executed once

Two-way decision 1. if (condition) then 2. statement 1 3.... 4. else 5. statement n+1 6.... 7. endif If the (condition) is TRUE then statements between THEN and ELSE are executed once If the (condition) is FALSE then statements between ELSE and ENDIF are executed once

LOOP For Loop Used to implement statements that needs to be repeated a fixed number of times. 1. for i 1 to n 2. Statement 1 3.... 4. next i i is the index or counter that starts with some value and increases by one every time through the loop until it reaches the given maximum value

Repeat until Repeat Loop Used to implement statements that needs to be repeated until the condition becomes TRUE. 1. repeat 2. Statement 1 3.... 4. until (condition)

While LOOP While Loop Used to implement statements that needs to be repeated while the condition is TRUE. 1. while (condition) 2. Statement 1 3.... 4. endwhile

Pseudocode for three constructs

Advantages Converting a pseudo code to a programming language is easier than converting a flow chart to programming language. It is easier to modify the pseudo code of a program logic when program modification is necessary. Required less time and effort than flow chart.

Limitations A graphical representation of program logic is not available. There are no standard rules to follow in using pseudo code. It is very difficult for beginners.

Example: Write a pseudocode to calculate the weekly wages of an employee. The pay depends on wages per hour and the number of hours worked. Moreover, if the employee has worked for more than 30 hours then he gets twice the wages per hour, for every extra hour that he has worked. Read hours worked Read wages per hour Set overtime charges to 0 Set overtime hrs to 0 If hours worked > 30 then Calculate overtime hrs = hours worked 30 Calculate overtime charges =overtime hrs * (2 * wages per hour) Set hours worked = hours worked - overtime hrs ENDIF Calculate salary = (hours worked * wages per hour) + overtime charges Display salary End Variables: hours worked, wages per hour, overtime charges, overtime hrs, salary