# Session Objectives# 24 COULD code the solution for an algorithm

## Presentation on theme: "Session Objectives# 24 COULD code the solution for an algorithm"— Presentation transcript:

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.

Pseudocode Flow Chart Syntax Error Logic Error Algorithm IDE
Key Words Key Words Pseudocode Flow Chart Syntax Error Logic Error Algorithm IDE

Flow Chart Symbols Revisited
Using white boards display what these symbols mean? 1. 2. 3. 4. 5. START/STOP Decision (IF or CASE Statements) Process either arithmetic ‘a + b’ or action ‘open file’ Input or Output Subroutine symbol – a subroutine is like a program within the program. It is used to simplify complex flow charts

Flow Charts KEY POINTS Commands are in caps, variables in lower case e.g Processes are generally a LET statement Other constructs include: IF process ELSE process 2 ENDIF or Loops (FOR –NEXT, REPEAT – UNTIL or WHILE – END WHILE) Pseudocode START/BEGIN INPUT width INPUT height LET area = width * height OUTPUT area STOP/END What will this programme do? Now write an algorithm for this programme START Input Width Input Height Area = Width x Height Output Area STOP

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.

Download ppt "Session Objectives# 24 COULD code the solution for an algorithm"

Similar presentations