Skip to main content
A-LevelComputer ScienceProgramming9618/22 · Oct/Nov 2021 · Q411 Marks

The following is a procedure design in pseudocode. Line numbers are given for reference only. 10 PROCEDURE Check(InString : STRING) 11 DECLARE Odds, Evens, Index : INTEGER 12 13 Odds ← 0 14 Evens ← 0 15 Index ← 1 16 17 WHILE Index <= LENGTH(InString) 18 IF STR_TO_NUM(MID(InString, Index, 1)) MOD 2 <> 0 THEN 19 Odds ← Odds + 1 20 ELSE 21 Evens ← Evens + 1 22 ENDIF 23 Index ← Index + 1 24 ENDWHILE 25 26 CALL Result(Odds, Evens) 27 ENDPROCEDURE

  1. (a)Complete the following table by giving the answers, using the given pseudocode. A line number containing a variable being incremented The type of loop structure The number of functions used The number of parameters passed to STR_TO_NUM() The name of a procedure other than Check() Answer[5]
  2. (b)The pseudocode includes several features that make it easier to read and understand. Identify three of these features. 1 2 3[3]
  3. (c)(i)The loop structure used in the pseudocode is not the most appropriate. State a more appropriate loop structure and justify your choice. Loop structure Justification[2]
  4. (c)(ii)The appropriate loop structure is now used. Two lines of pseudocode are changed and two lines are removed. Write the line numbers of the two lines that are removed.[1]

Mark scheme

Marking points from the official mark scheme (Oct/Nov 2021). The mark or mark type is shown in brackets.

  1. [1] A line number containing a variable being incremented: 19 / 21 / 23
  2. [1] The type of loop structure: pre-condition
  3. [1] The number of functions used: 3
  4. [1] The number of parameters passed to STR_TO_NUM(): 1
  5. [1] The name of a procedure other than Check(): Result
  6. [1] Meaningful variable names
  7. [1] Indentation / white space / blank lines
  8. [1] Capitalisation of keywords
  9. [1] Loop structure: A count-controlled loop
  10. [1] Justification: The number of iterations is known // repeats for the length of InString
  11. [1] 15, 23

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Programming, A-Level Computer Science (syllabus 9618). Structured question, 11 marks.
Source
A-Level Computer Science, Oct/Nov 2021 Paper 2 Variant 2, question 4.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep