Past-paper question · 2019 May-June · Paper 32 · Q3

Question 3 2019 · May-June · Paper 32 · 0 marks

Original past-paper question for 3
Reveal official mark-scheme answer Official mark-scheme answer for 3Official mark-scheme answer for 3

Official answer for Question 3

Question 8

✓
Line number of error and
✓
Explanation of suggested
✓
explanation of error
✓
correction
✓
Line 6/9 and the function is spelt
✓
Should be same as function/
✓
incorrectly / differently, so will not
✓
CheckAgeFunction/
✓
run on button click
✓
CheckAgFunction
✓
Line 8 script is not opened so web
✓
Add <script> to open the script
✓
browser cannot interpret it
✓
Line 9 missing {/open curly bracket
✓
Add {/open curly bracket
✓
so line is not terminated correctly
✓
Line 10 the variable CanApply is
✓
Add , to separate variables / add
✓
new line with var / add CanApply
✓
function
✓
to declare the variable
✓
Line 15 age is wrongly shown as
✓
Should be 16 as per intended age
✓
15 so age check is incorrectly
✓
check/stem/line 3
✓
compared
✓
Line 15 incorrect logic comparison
✓
Change to < for correct
✓
so age messages are reversed
✓
comparison/reverse the messages
✓
when displayed
✓
to match comparison
✓
Line 17 “ is missing from
✓
Add “
✓
("AgeCheck “ so AgeCheck is not
✓
interpreted as p id so its value is
✓
Line 19 script is not closed so web
✓
Add </script> to close the script
✓
browser cannot interpret it
✓
1 mark for error and 1 mark for matching correction.
✓
9626/32
✓
Cambridge International AS/A Level – Mark Scheme
✓
May/June 2019
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9626_s19_ms_32.pdf →

Show text version of question

Question 3

An author has written the source code of a web page that will be used when a person applies for a driving licence. The code, shown in Fig. 3.1, is intended to check that a person is at least 16 years of age.

The lines of the code are numbered only for your convenience when referring to the code. The JavaScript code is in lines 8 to 19.

1 <html> 2 <body> 3 <p>You can apply for a licence to drive when you are 16 years old.</p>

Topic relevance

Why this question appears here

98% assigned-topic match · Programming for the web

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 9626_s19_qp_32.pdf

Keep practising this topic