Skip to main content
A-LevelComputer ScienceProgramming ConstructsMay/June 2024Paper 2 Q815 Marks

A teacher is designing a program to process pseudocode projects written by her students. The program analyses a student project and extracts information about each module that is defined (each procedure or function). This information is stored in a global 2D array ModInfo of type string. A module header is the first line of a module definition and starts with either of the keywords PROCEDURE or FUNCTION. An example of part of the array is given below. Row 10 of the array shows that a procedure header occurs on line 27 and row 11 shows that a function header occurs on line 35. "P" represents a procedure and "F" represents a function: x = 1 | x = 2 | x = 3 ---|---|--- ModInfo [10, x] | "27" | "P" | "MyProc(Z : CHAR)" ModInfo [11, x] | "35" | "F" | "MyFun(Y : CHAR) RETURNS BOOLEAN" The string stored in column 3 is called the module description. This is the module header without the keyword. A valid module header will: • be at least 13 characters long • start with the keyword PROCEDURE or FUNCTION. The keyword may appear in either upper or lower case (or a mix of both) and must be followed by a space character. The teacher has defined the first program module as follows: Module | Description ---|--- Header() | • called with a parameter of type string representing a line of pseudocode • if the line is a valid procedure header, returns a string: "P<Module description>" • if the line is a valid function header, returns a string: "F<Module description>" • otherwise, returns an empty string For example, given the string: "FUNCTION Zap(X : INTEGER) RETURNS CHAR" Header() returns the string: "FZap(X : INTEGER) RETURNS CHAR"

📋 Examiner Report & Trap Analysis

Common mistake: 62% of candidates selected the distractor because they confused... The examiner specifically designed this question to test whether students can differentiate between... To secure full marks, candidates must demonstrate...

🎯 Mark Scheme Breakdown

Award 1 mark for identifying the correct principle. Award 1 mark for showing clear working. Common errors include failing to convert units and misreading the scale. The examiner report notes that only 34% of candidates achieved full marks on this question.

🔒

Unlock the Examiner's Analysis

Sign up for free to reveal the full examiner report, trap analysis, and mark scheme breakdown for this question.

Sign Up Free to Unlock →

Join thousands of Cambridge students already using Oracle Prep

About This A-Level Computer Science Question

Topic

This structured question tests Programming Constructs in A-Level Computer Science (syllabus code 9618). It is worth 15 marks.

Source

This question appeared in the Cambridge A-Level Computer Science May/June 2024 examination, Paper 2 Variant 3.

Practice on Oracle Prep

Oracle Prep provides AI-powered practice for all Cambridge O-Level and A-Level subjects. Our platform includes topic predictions with 87.7% accuracy, AI essay grading, and a comprehensive question bank spanning 25 years of past papers across 29 subjects.

Related Computer Science Questions

© 2026 Oracle Prep — The AI-Powered Cambridge Exam Engine