Skip to main content
A-LevelComputer ScienceProgramming9618/23 · May/June 2023 · Q46 Marks

A function MakeString() will: 1. take two parameters: • a count as an integer • a character 2. generate a string of length equal to the count, made up of the character 3. return the string generated, or return "ERROR" if the count is less than 1. For example, the function call: MakeString(3, 'Z') will return the string "ZZZ"

  1. Write pseudocode for function MakeString().[6]

Mark scheme

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

  1. [6] FUNCTION MakeString(Count : INTEGER, AChar : CHAR) RETURNS STRING
  2. [6] DECLARE MyString : STRING
  3. [6] DECLARE Index : INTEGER
  4. [6] IF Count < 1 THEN
  5. [6] MyString ← "ERROR"
  6. [6] ELSE
  7. [6] MyString ← ""
  8. [6] FOR Index ← 1 TO Count
  9. [6] MyString ← MyString & AChar
  10. [6] NEXT Index
  11. [6] ENDIF
  12. [6] RETURN MyString
  13. [6] ENDFUNCTION
  14. [6] MP1 Function heading and end including parameters and return type
  15. [6] MP2 Declaration of locals Index and MyString
  16. [6] MP3 Test for Count < 1 and if true, assign "ERROR" to MyString / Immediate RETURN
  17. [6] MP4 Loop for Count iterations
  18. [6] MP5 Use of concatenate – must have been initialised in a loop
  19. [6] MP6 Return STRING (correctly in both cases)

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, 6 marks.
Source
A-Level Computer Science, May/June 2023 Paper 2 Variant 3, 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