Question 2(b) 2023 · May-June · Paper 22 · 2 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
Question 2
Show text version of question
Question 2
Part (b)
Question 2
A program stores a user’s date of birth using a variable MyDOB of type DATE.
Part (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.
.............................................................................................................................................
Why this question appears here
71% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_s23_qp_22.pdf
