Revise Computingrevisecomputing.co.uk
Free student revisionSee questionsFor schoolsSchool enquiry
Free revisionSee questionsFor schoolsSchool enquiry
Knowledge/A Level/H446/01 Computer systems/Software Development/Writing and following algorithms

Writing and following algorithms

1.2.3 Software Development

Practise exam questions

Software Development — Note 3 of 3

Candidates need to be able to write algorithms using pseudocode and/or program code. Candidates need to be able to follow the code as shown in the OCR pseudocode guide, but are not expected to write code in this syntax. Candidate’s code is not expected to be syntactically correct, but must use appropriate code structures.

What you need to know

An algorithm is a sequence of steps to solve a problem. You need to be able to write algorithms in pseudocode or program code, and follow (trace) algorithms written in OCR's pseudocode style to work out what they do.

What to know

  • You can write algorithms in pseudocode or a high-level language. Your code does not need to follow OCR syntax exactly, but must use correct programming structures and be unambiguous.
  • You must be able to READ the OCR pseudocode style (see appendix 5d), e.g. for i = 0 to 7 ... next i, while ... endwhile, if ... then ... elseif ... else ... endif.
  • Tracing: work through an algorithm line by line, recording the value of each variable and any output in a trace table.
  • Algorithms can also be shown as flowcharts using standard symbols.

Key terms

Exam tipCommon mistake

Algorithm

A finite sequence of well-defined steps that solves a problem.

  • Exam tip: When writing an algorithm, initialise variables, use meaningful names and indent consistently so the examiner can follow your logic.

Exam technique

  • Mistake:Forgetting that OCR's for i = 0 to 7 INCLUDES 7 (8 iterations), unlike Python's range(0, 7).

Code examples

OCR pseudocode: find the largest value in an array
text
function largest(nums)
    max = nums[0]
    for i = 1 to nums.length - 1
        if nums[i] > max then
            max = nums[i]
        endif
    next i
    return max
endfunction

Ready to test yourself?

Practise 1.2.3 questions
← Previous noteThe relative merits and drawbacks of different methodologies and when they might be used1.2.3 Software DevelopmentNext topic →The need for and characteristics of a variety of programming paradigms1.2.4 Types of Programming Language

Back to Software Development

Software Development

Note 3 of 3

  1. 1Waterfall lifecycle, agile methodologies, extreme programming, spiral model and RAD
  2. 2The relative merits and drawbacks of different methodologies and when they might be used
  3. 3Writing and following algorithms
Topic overview