Computer Science 9618 ยท Chapter 21 of 21
Paper 2: Pseudocode step by step (arrays, functions, procedures)
8 revision notes on Paper 2: Pseudocode step by step (arrays, functions, procedures) for Cambridge A Level Computer Science (9618). Every 9618 Paper 2 (and the older 9608 Paper 2) with mark schemes, in Yearly papers.
About this chapter
- Syllabus
- 9-12
- Section
- AS Level ยท Paper 2 Fundamental Problem-solving and Programming Skills
- Level
- AS Level
- Paper 2
- 2 hours ยท 75 marks ยท 50% of the AS
- Last question
- a 15-20 mark scenario: a Module | Description table, then write each module
- Arrays
- a global 1D or 2D array in 23 of 33 recent papers' last question
- Also needs
- string functions (MID, LENGTH, ...), functions and procedures, text files
- Reading time
- 8 notes ยท about 129 min
- Practise with
- Every 9618 Paper 2 (and the older 9608 Paper 2) with mark schemes, in Yearly papers.
Study these notes in order
8 notes cover this chapter. Work through them 1 โ 8: each one ends with a quiz, so you know you're ready for the next.
Start here ยท Note 1 of 8 ยท 15 min read
Pseudocode toolkit: the rules and the three loops
- Pseudocode toolkit
- Strings
- Functions and procedures
- 1D arrays
- 1D arrays
- 1D arrays
- 1D arrays
- 1D arrays
Not in the notes yet: 2D arrays, Records, Text files, Stacks, queues and linked lists, Questions without code, Exam technique and past papers
Download and print
A4 PDFs of the 8 notes above, ready to print or use offline.
What the syllabus says you need to know
- Write pseudocode that uses the basic constructs: assignment, selection (IF, CASE) and iteration (count-controlled, pre-condition and post-condition loops)
- Use built-in string functions and operators (LENGTH, MID, LEFT, RIGHT, TO_UPPER, TO_LOWER, NUM_TO_STR, STR_TO_NUM, IS_NUM, ASC, CHR, &, MOD, DIV, INT)
- Write and use procedures and functions, with parameters passed by value and by reference, and explain local and global variables
- Declare and use 1D and 2D arrays, including the upper and lower bounds
- Write algorithms that process arrays: count, total, average, maximum/minimum, linear search, bubble sort, unused elements
- Define and use records (composite data types) and arrays of records
- Write pseudocode to handle text files: open, read, write, append, close, test for end of file
- Implement a stack, a queue and a linked list using arrays
- Dry-run an algorithm with a trace table; convert between flowcharts and pseudocode; use structure charts, state-transition diagrams and test data
Can I do this? Chapter checklist
Pseudocode toolkit: the rules and the three loops
Strings: the built-in functions and four patterns
- I know what LENGTH, LEFT, RIGHT and MID give back, and that positions start at 1.
- I convert with NUM_TO_STR / STR_TO_NUM before joining or comparing.
- I can loop through a string and build a new one.
- I can find the position of a character and split a string there.
- I can test whether a character is a capital, a small letter, a digit or a space.
Functions and procedures: parameters, BYREF and module tables
- I can say when a module is a procedure and when it is a function.
- I write correct headers with parameter types and RETURNS, and call each kind correctly.
- I can explain local and global variables.
- I can explain BYVAL and BYREF and use BYREF to give back more than one value.
- I can turn each bullet of a Module | Description table into code.
Arrays 1: boxes, indexes and the FOR loop
- I can explain index, element, lower bound and upper bound, and why an array beats separate variables.
- I can declare a 1D array and work out how many elements it has.
- I know the difference between i (the index) and A[i] (the value).
- I can initialise, input into and output every element with a FOR loop.
- I can dry-run array code in a trace table, including indexes like i - 1.
Arrays 2: count, total, average and the highest
Arrays 3: search, unused elements and duplicates
Arrays 4: swap, shift and bubble sort
Arrays 5: parallel arrays, copying and arrays in modules
- I can use the same index in parallel arrays, and sort them without breaking the pairs.
- I can filter one array into another with two indexes, and say how many were copied.
- I can use a global array in a module, and pass an array BYVAL or BYREF correctly.
- I can write modules that filter, tidy up and call each other.
Ticks are saved on this device and match the checklist at the end of each note. Anything unticked: open it and revise that section.