flowcharting an introduction. definition a flowchart is a schematic representation of an algorithm...

17
Flowcharting An Introduction

Upload: edwina-mills

Post on 13-Dec-2015

214 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Flowcharting

An Introduction

Page 2: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Definition

A flowchart is a schematic representation of an algorithm or a process.

Page 3: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Parts of a Flowchart

Start/endprocess

input

decision

arrows

displaydelay

Page 4: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Start/End

• Shape is a rounded rectangle

• Start is required of all flow charts

• Some flow charts may not have an END

Page 5: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Process

• Shape is rectangular

• Process involves the action or the “verb” part of the flowchart

Page 6: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Input/Output

• Shape is a parallelogram

• Indicates where manual operation is needed

Page 7: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Decision

• Shape is a rhombus

• Outcome is either yes or no

Page 8: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Delay

• Used to indicate a pause in the program

Page 9: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Arrows

• Indicate the flow of the chart

• Drawn from the output of one block to the input of another

• Only one arrow can represent outputs

• Multiple arrows may represent inputs

Page 10: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Example

• Count from 1 to 10 by the odd numbers.

• Before attempting to draw, determine what you want the output to be.

• What is the first block (always)?

Page 11: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Step 1

• The output will be 1, 3, 5, 7, 9.

• The Start block is always first.

START

Page 12: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Step 2

• One option is to input the number.

START

INPUT 1

Page 13: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Step 4

• Now that we have the number, we need to demonstrate it.

START

INPUT 1

SAY NUMBER

Page 14: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Step 3

• We have 1. How do we get the next number?

START

INPUT 1

ADD 2

SAY NUMBER

Page 15: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Step 4

We don’t want to keep adding 2. When do we stop?

Is number >10?

START

INPUT 1

ADD 2

SAY NUMBER

Page 16: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Step 5

The decision block has two directions, yes or no. Where do they go?

END

NO

YES

Is number >10?

START

INPUT 1

ADD 2

SAY NUMBER

Page 17: Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process

Your Turn

Create a flow chart that shows how to pour a glass of milk.