Skip to main content
A-LevelComputer ScienceProgramming9618/22 · Oct/Nov 2023 · Q69 Marks

A procedure CreateFiles() will take two parameters: : a string representing a file name an integer representing the number of files to be created. The procedure will create the number of text files specified. Each file is given a different name. Each file name is formed by concatenating the file name with a suffix based on the file number. The suffix is always three characters. For example, the call CreateFiles("TestData", 3) would result in the creation of the three files, TestData.001, TestData.002 and TestData.003. Each file will contain a single line. For example, file TestData.002 would contain the string: This is File TestData.002 Write pseudocode for CreateFiles(). Assume both parameters are valid and that the integer value is between 1 and 999, inclusive.

  1. (a)A procedure CreateFiles() will take two parameters: : a string representing a file name an integer representing the number of files to be created. The procedure will create the number of text files specified. Each file is given a different name. Each file name is formed by concatenating the file name with a suffix based on the file number. The suffix is always three characters. For example, the call CreateFiles("TestData", 3) would result in the creation of the three files, TestData.001, TestData.002 and TestData.003. Each file will contain a single line. For example, file TestData.002 would contain the string: This is File TestData.002 Write pseudocode for CreateFiles(). Assume both parameters are valid and that the integer value is between 1 and 999, inclusive.[6]
  2. (b)(i)Identify the type of module that should be used for CheckFiles().[1]
  3. (b)(ii)Write the module header for CheckFiles().[1]
  4. (b)(iii)State the file mode that should be used in CheckFiles().[1]

Mark scheme

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

  1. [6] Mark as follows:
  2. 1 Procedure heading, including parameters, and ending
  3. 2 Loop for NumFiles iterations
  4. 3 Attempt to create filename suffix using NUM_TO_STR() in a loop
  5. 4 Completely correct filename
  6. 5 OPENFILE in WRITE mode and subsequent CLOSE in a loop
  7. 6 WRITE initial first line to the file in a loop
  8. [1] Function
  9. [1] FUNCTION CheckFiles (NameRoot : STRING) RETURNS INTEGER
  10. [1] Read

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, 9 marks.
Source
A-Level Computer Science, Oct/Nov 2023 Paper 2 Variant 2, question 6.

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