GCSEComputing_Session24

advertisement
Session Objectives# 24
COULD code the solution for an algorithm
SHOULD write pseudocode for an algorithm
MUST identify flow chart symbols
Recreate the solution in a high level language with a continue or exit
clause.
GCSE Computing#BristolMet
Key Words
GCSE Computing#BristolMet
Flow Chart Symbols Revisited
Using white boards display what these symbols mean?
1.
2.
3.
START/STOP
Decision (IF or CASE
Statements)
Process either
arithmetic ‘a + b’ or
action ‘open file’
4.
Input or Output
5.
Subroutine symbol – a subroutine is like a
program within the program. It is used to
simplify complex flow charts
GCSE Computing#BristolMet
Flow Charts
KEY POINTS
Pseudocode
What will this
programme
do? Now write
an algorithm
for this
programme
START
START/BEGIN
Input
Width
INPUT width
Input
Height
Area =
Width x
Height
Output
Area
STOP
GCSE Computing#BristolMet
INPUT height
Commands are in
caps, variables in
lower case e.g
Processes are
generally a LET
statement
LET area = width * height Other constructs
include:
IF
process
OUTPUT area
ELSE
process 2
STOP/END
ENDIF or Loops (FOR –
NEXT, REPEAT – UNTIL
or WHILE – END
WHILE)
Creating Flow Charts & Pseudocode
Flow charts and pseudocode are methods of designing algorithms
to solve problems. They are useful to make sure the logic of
the algorithm is correct with no logic errors before starting to
programme, when the programmer is then faced with the prospect
of language specific syntax errors.
Logic errors – problems with the flow and structure of a
programme
Syntax errors – problems with the spelling and punctuation of a
programme.
TASKS:
Now turn to page 156 and complete tasks 1 – 4.
Extension Task 1 and the code a solution to any of your
algorithms in Python. Aim to include a continue/exit feature.
GCSE Computing#BristolMet
Download