A program stores a date of birth for a student using a variable, MyDOB, of type DATE.
- (a)MyDOB has been assigned a valid value corresponding to Kevin's date of birth. Complete the pseudocode statement to test whether Kevin was born on a Thursday. IF THEN[2]
- (b)(i)A function CheckDate() will take three integer parameters representing a day, month and year of a given date. The function will validate the date of birth for a student that the parameters passed to it represent. For a date to be valid, a student must be at least 18 in year 2020. Two of the parameter values can be checked without reference to the third parameter. Describe these two checks. Check 1 Check 2[2]
- (b)(ii)Several values of the parameter representing the day can only be checked completely by referring to the value of one other parameter. Describe this check.[2]
Mark scheme
Marking points from the official mark scheme (May/June 2023). The mark or mark type is shown in brackets.
- [2] One mark for each underlined part
- [2] IF DAYINDEX(MYDOB) = 5 THEN
- [2] MP1 Value for month is between 1 and 12 (inclusive)
- [2] MP2 Value of year is <= 2002
- [2] MP1 Reference to month and day
- [2] MP2 Clear description for a check that the day number matches with a relevant month
- [2] (Either day matches with month // month matches with day)
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 →