Skip to main content
A-LevelComputer ScienceFurther programming9618/22 · May/June 2023 · Q29 Marks

A program stores a user's date of birth using a variable MyDOB of type DATE.

  1. (a)Write a pseudocode statement, using a function from the insert, to assign the value corresponding to 17/11/2007 to MyDOB.[1]
  2. (b)MyDOB has been assigned a valid value representing the user's date of birth. Write a pseudocode statement to calculate the number of months from the month of the user's birth until the end of the year and to assign this to the variable NumMonths. For example, if MyDOB contains a value representing 02/07/2008, the value 5 would be assigned to NumMonths.[2]
  3. (c)The program will output the day of the week corresponding to MyDOB. For example, given the date 22/06/2023, the program will output "Thursday". An algorithm is required. An array will be used to store the names of the days of the week. Define the array and describe the algorithm in four steps. Do not use pseudocode statements in your answer. Array definition Step 1 Step 2 Step 3 Step 4[6]

Mark scheme

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

  1. [1] MYDOB ← SETDATE(17, 11, 2007)
  2. [2] NumMonths ← 12 – MONTH(MyDOB) One mark per underlined part
  3. [6] One mark per array definition bullet: • A (1D) array containing 7 elements • of type STRING One mark per Step: Step1: Assign value "Sunday" to first element, "Monday" to second element etc. Step2: Use the function DAYINDEX() to return / find the day number from MyDoB Step3: Use the returned value as the array index / to access the element that contains the name / string Step4: Output the element / name / string Note: Max 2 for Array definition, Max 4 for steps

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
Further programming, A-Level Computer Science (syllabus 9618). Structured question, 9 marks.
Source
A-Level Computer Science, May/June 2023 Paper 2 Variant 2, question 2.

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