Computer Science For IGCSE & O Level CourseBook

Page 76

We are working with Cambridge Assessment International Education towards endorsement of these titles. CAMBRIDGE IGCSE™ & O LEVEL COMPUTER SCIENCE: PROGRAMMING BOOK

Flowcharts

KEY WORD

A flowchart is a graphical representation of a detailed design for an algorithm. It uses a set of symbols, which are illustrated and defined in Table 2.1. Symbol

Use The terminator symbol: there is one at the start and one at the end (referred to as ‘stop’) of the flowchart sequence.

flowchart: a diagram used to document a detailed design for an algorithm that shows the logical flow of the actions.

FT

An action symbol: it is used to show that the action required is either an input of a value or the output of a value. There must be only one arrow going in and one arrow going out.

An action symbol: sometimes referred to as the ‘process symbol’. It is where one or more actions can be defined. There must be only one arrow going in and one arrow going out.

A

An action symbol: referred to as the ‘decision symbol’. It defines a condition to be tested.

There must be only one arrow going in but there must be two arrows coming out.

R

One of the outgoing arrows must be marked TRUE or T and the other marked FALSE or F. The arrow is used to define the sequence or flowline of the actions defined in the flowchart.

Table 2.1: Flowchart symbols

D

There are a couple of points to make about the use of flowcharts: 1

2

A flowchart is normally presented as a design going from top to bottom, rather than from left to right, with the start terminator at the top and the stop terminator at the bottom. A flowchart is normally used for a detailed design. In this case, each of the three action symbols must contain specific details of the action. Pseudocode is suitable for this.

In the following chapters, when a detailed design is provided for you, this will usually be presented as a flowchart and as pseudocode. Flowchart 2.1 shows an example of a flowchart constructed as a preliminary design for a program that provides a quiz for a user. Note how iteration is included by the use of an arrow returning to an earlier stage in the algorithm.

12 Original material © Cambridge University Press 2021. This material is not final and is subject to further changes prior to publication.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Computer Science For IGCSE & O Level CourseBook by Cambridge International Education - Issuu