0% found this document useful (0 votes)
16 views5 pages

Computational Thinking and Programming

Uploaded by

Dozy Omondi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views5 pages

Computational Thinking and Programming

Uploaded by

Dozy Omondi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Computational thinking and programming

1.1 Flowcharts
Following flowcharts

 A flowchart is a diagram that shows a sequence of steps that should be followed.


 A flowchart has to follow set rules. These rules include:
• Specific shapes for different purposes:
a. input – for the user to enter data
b. process – to do a calculation or action
c. output – to display words and numbers to the user
• A start and a stop sometimes these might be labelled ‘begin’ and ‘end’.
• Data flows -the arrows that show you how to move through the flowchart
Flowchart shapes and their purpose.

Data flow-A data flow is an arrow. The arrows show you which box to move to next.
Questions 1.1
1 What is the shape of the output box?
2 What is the shape of the process box?
3 How many data flows go into a start box?
4 How many data flows go into a stop box?
Following a flowchart
To follow a flowchart:
• find the start box
• follow the arrow from start to the next shape
• perform the action in each shape
• continue until you reach the stop box.
Storing data

Read this flowchart:

 This flowchart uses a variable.


 A variable is a named storage location where you can store data.
 The data value can change in a variable.
 In this flowchart, the variable is age.
 The flowchart can put data into age, for example:

 The data the user enters will be stored in age.


 The flowchart can change the data in age, for example:

 This adds 10 to age and then stores the result.


 The flowchart can access the data in age, for example:

 This will output the contents of age.


Editing and correcting flowcharts
You may be given a flowchart that does not work or one that needs to be
changed to do something new, or to do something extra.
Before you do either of these, you first need to trace the algorithm yourself. You need to walk
through the flowchart one step at a time to find out what it does.
Correcting errors
If you need to correct an error, compare what the flowchart does to what it should do. For
example, the number 20 is output instead of the number 10.
You need to find out why and then make the change.
Common errors may include:
 using the wrong mathematical operator (+, -, *, /)
 using the wrong values in a calculation
 not taking the correct value as input from the user
 outputting an incorrect value.
You need to test the flowchart before you look for the error, and then
test it again with the same data after to make sure it now works.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy