Question 4(b) 2015 · May-June · Paper 23 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (b)
Part (b)
•
Show text version of question
Question 4
Part (b)
Question 4
A leap year is a year with special numerical properties.
Ahmed is planning to write a function to check whether a year is a leap year.
He starts by drawing a flowchart.
FUNCTION IsLeapYear(Year)
Is Year exactly No Is Year exactly No Is Year exactly No divisible by 400? divisible by 100? divisible by 4?
Yes Yes Yes
RETURN RETURN RETURN RETURN TRUE FALSE TRUE FALSE
ENDFUNCTION
Question 15
Part (b)
Ahmed wants to carry out white box testing of the function.
Give four integers which thoroughly test the function. For each one, give the expected return value and justify your choice.
Year Expected Justification return value
......................................................................................
Question 1
......................................................................................
......................................................................................
......................................................................................
Question 2
......................................................................................
......................................................................................
......................................................................................
Question 3
......................................................................................
......................................................................................
......................................................................................
Question 4
......................................................................................
......................................................................................
Why this question appears here
71% assigned-topic match · Hardware › Logic gates and logic circuits
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 9691_s15_qp_23.pdf
