Presentation on theme: "Session Objectives# 24 COULD code the solution for an algorithm"— Presentation transcript:
1 Session Objectives# 24 COULD code the solution for an algorithm SHOULD write pseudocode for an algorithmMUST identify flow chart symbolsRecreate the solution in a high level language with a continue or exit clause.
3 Flow Chart Symbols Revisited Using white boards display what these symbols mean?22.214.171.124.5.START/STOPDecision (IF or CASEStatements)Process either arithmetic ‘a + b’ or action ‘open file’Input or OutputSubroutine symbol – a subroutine is like a program within the program. It is used to simplify complex flow charts
4 Flow ChartsKEY POINTSCommands are in caps, variables in lower case e.gProcesses are generally a LET statementOther constructs include:IFprocessELSEprocess 2ENDIF or Loops (FOR –NEXT, REPEAT – UNTIL or WHILE – END WHILE)PseudocodeSTART/BEGININPUT widthINPUT heightLET area = width * heightOUTPUT areaSTOP/ENDWhat will this programme do? Now write an algorithm for this programmeSTARTInput WidthInput HeightArea = Width x HeightOutput AreaSTOP
5 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 programmeSyntax 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.