Introduction to Flowcharting

Slides:



Advertisements
Similar presentations
Programs/Algorithms.  Computer Architecture  What is a computer program?  Flow chart  Data states  Data  Variables  History – Why VB?  Procedural.
Advertisements

Introduction to Flowcharting
Introduction to Flowcharting
Flow Control Analysis & Design Tool: Flowcharts
UNIT 2. Introduction to Computer Programming
Introduction to Flowcharting
Use Flowchart Symbols for Structured Programming
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
Using Flowcharts. Sample Flowchart (without text) 2.
Documentation Letts Study Guide Information Systems - IT Chapter 19.
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
ACG 4401 Data Modeling: Data Flow Diagrams Flow Charts.
Fundamentals of Algorithms MCS - 2 Lecture # 4
Chapter 2: Input, Processing, and Output
Chapter 3 Planning Your Solution
The Program Design Phases
(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.
CSC103: Introduction to Computer and Programming
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 5 Structured Program.
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.
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
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.
Flowcharts.
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.
Flowcharts & Sitemaps Integral part of the design process –Show all possible paths and the various activies such as navigation, games, tests, transactions,
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
1 Introduction to Flowcharting Computer Science Principles ASFA.
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. Flow charts A flowchart is a schematic (idea of doing something) representation of a process. They are commonly used in Computer Science.
Problem Solving Flowcharts. Flowcharts Introduction  Flowcharts allow us to create a visual representation of a solution to a problem DRAW  With flowcharts,
Algorithms and Flowcharts
Lecture #2: Introduction to Flowcharting مخططات الانسياب Dr. Hmood Al-Dossari King Saud University Department of Computer Science 13 February 2012.
Pseudocode (pronounced SOO-doh-kohd)  is a detailed yet readable description of what a computer program or algorithm must do, expressed in a formally-styled.
Creating Flowcharts Principles of Engineering
Creating a Flowchart Computer Integrated Manufacturing
ALGORITHMS AND FLOWCHARTS
Flow Charts Basic Flow Chart Symbols Few sample flowcharts Rules
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Chapter 2: Input, Processing, and Output
The Selection Structure
Introduction to Flowcharting
Flowcharting: Decision Structure
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.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Introduction to Flowcharting
Creating Flowcharts Principles of Engineering
Activity Diagrams Activity diagrams describe the workflow behavior of a system.  The diagrams describe the state of activities by showing the sequence.
Creating Flowcharts AIM:
Creating Flowcharts Principles of Engineering
How to develop a program?
PROBLEM SOLVING CSC 111.
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Introduction to Algorithms and Programming
Faculty of Computer Science & Information System
ME 142 Engineering Computation I
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Developing a Program.
Creating Flowcharts Principles of Engineering
Chapter 2: Input, Processing, and Output
Introduction to Flowcharting
Creating Flowcharts Principles Of Engineering
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Introduction to Programming
Introduction to Flowcharts
Presentation transcript:

Introduction to Flowcharting

Objective A program can be divided into 3 parts: Input data Processing data – Calculation, etc. Output information/results Calculation/ Processing Input Output

Arrows From Top to Bottom & from Left to Right Make turn Join together NOTE: Lines/Arrows must always be horizontal or vertical and never cross to avoid confusion

What is a Flowchart? START Display message “How many hours did you work?” Read hours Display message “How much do you get paid per hour?” Read payRate Multiply hours by payRate. Store result in grossPay. Display grossPay END A flowchart is a diagram that depicts the “flow” of a program. A diagram made up of symbols of various shapes connected by arrows. Those symbols indicate either actions to be taken or decisions to be made. It helps us planning & programming. The figure shown here is a flowchart for a pay-calculating program. NOTE: Like IPO charts, there should be nothing programming language specific, just use descriptive words, e.g. “Read” or “Display”

Four Flowchart Structures Sequence (Today) Decision Case Repetition

Sequence Structure A series of actions are performed in sequence The pay-calculating example was a sequence flowchart.

Basic Flowchart Symbols Rounded Rectangle START Display message “How many hours did you work?” Read hours Notice there are three types of symbols in this flowchart: rounded rectangles parallelograms rectangles Each symbol represents a different type of operation. Display message “How much do you get paid per hour?” Parallelogram Read payRate Multiply hours by payRate. Store result in grossPay. Rectangle Display grossPay Rounded Rectangle END

Terminals: Rounded Rectangles START Display message “How many hours did you work?” Terminals represented by rounded rectangles indicate a starting or ending point Only 1 of each allowed! Read hours Display message “How much do you get paid per hour?” Read payRate Multiply hours by payRate. Store result in grossPay. START Display grossPay END Terminal END

I/O Operations: Parallelograms START Display message “How many hours did you work?” Input/Output Operations represented by parallelograms indicate an input or output operation Read hours Display message “How much do you get paid per hour?” Input/Output Operation Read payRate Multiply hours by payRate. Store result in grossPay. Display message “How many hours did you work?” Read hours Display grossPay END

Processing: Rectangles START Display message “How many hours did you work?” Processes represented by rectangles indicates a process such as a mathematical computation or variable assignment (not definition) Read hours Display message “How much do you get paid per hour?” Read payRate Calculate grossPay as hours * payRate Multiply hours by payRate. Store result in grossPay. Process Multiply hours by payRate. Store result in grossPay. Set name to “Fred” Display grossPay END

Stepping Through the Flowchart START Display message “How many hours did you work?” In the next seven slides we will step through each symbol in the flowchart. We will show the program output and the contents of the variables. Read hours Display message “How much do you get paid per hour?” Read payRate Multiply hours by payRate. Store result in grossPay. Variable Contents: hours: ? payRate: ? grossPay: ? Display grossPay END

Stepping Through the Flowchart START Step 1: An Output Operation Display message “How many hours did you work?” Read hours Screen Output How many hours did you work? Display message “How much do you get paid per hour?” Read payRate Multiply hours by payRate. Store result in grossPay. Variable Contents: hours: ? payRate: ? grossPay: ? Display grossPay END

Stepping Through the Flowchart START Display message “How many hours did you work?” Read hours Step 2: An Input Operation (User types 40) How many hours did you work? 40 Display message “How much do you get paid per hour?” Read payRate Multiply hours by payRate. Store result in grossPay. Variable Contents: hours: 40 payRate: ? grossPay: ? The value 40 is stored in hours. Display grossPay END

Stepping Through the Flowchart START Display message “How many hours did you work?” Read hours Screen Output How much do you get paid per hour? Display message “How much do you get paid per hour?” Step 3: An Output Operation Read payRate Multiply hours by payRate. Store result in grossPay. Variable Contents: hours: 40 payRate: ? grossPay: ? Display grossPay END

Stepping Through the Flowchart START Display message “How many hours did you work?” Read hours How much do you get paid per hour? 20 Display message “How much do you get paid per hour?” Read payRate Step 4: Input Operation (User types 20) Multiply hours by payRate. Store result in grossPay. Variable Contents: hours: 40 payRate: 20 grossPay: ? Display grossPay The value 20 is stored in payRate. END

Stepping Through the Flowchart START Display message “How many hours did you work?” Read hours How much do you get paid per hour? 20 Display message “How much do you get paid per hour?” Step 5: The product of hours times payRate is stored in grossPay Read payRate Multiply hours by payRate. Store result in grossPay. Variable Contents: hours: 40 payRate: 20 grossPay: 800 Display grossPay The value 800 is stored in grossPay. END

Stepping Through the Flowchart START Display message “How many hours did you work?” Read hours Screen Output Your gross pay is 800 Display message “How much do you get paid per hour?” Read payRate Multiply hours by payRate. Store result in grossPay. Variable Contents: hours: 40 payRate: 20 grossPay: 800 Display grossPay Step 6: An Output Operation END

Connectors Sometimes a flowchart will not fit on one page. A connector (represented by a small circle) allows you to connect two flowchart segments. A

Connectors The “A” connector indicates that the second flowchart segment begins where the first segment ends. If you needed multiple connectors, you would use different letters for each, e.g. “B”, “C” Think of it as a “teleporter” A START END

Review What do each of the following symbols represent? (Answer on next slide)

Review What do each of the following symbols represent? Terminal Input/Output Operation Process

Review Name the four flowchart structures. Sequence Decision Repetition Case (Answer on next slide)