Question 6 2018 · February-March · Paper 32 · 8 marks
Reveal official mark-scheme answer
Official answer for Question 6
Question 8
Show text version of question
Question 6
Drivers who are 16 years of age or older can apply for a driving licence online. The government web page code requires applicants to enter their age and then checks if they are old enough to apply. The following code captures the applicant’s age. When the applicant clicks the ‘Check now’ button the age is first checked to ensure that it is numeric. The age is then checked to see if the applicant is old enough. Suitable messages are displayed as a result of the checks. Complete the code for the function CheckAgeFunction that checks the age entered by the applicant and displays an appropriate response. <html> <body> <p>You can apply for a licence to drive when you are 16 years old.</p> <p>To check if you are old enough to drive, input your age and click the button:</p> <input id="AgeNow" value="16" /> <button onclick="CheckAgeFunction()">Check now</button> <p id="AgeCheck"></p> <script> function CheckAgeFunction() { .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ......................................................................................................................................................[8] } document.getElementById("AgeCheck").innerHTML = CanApply; } </script> </body></html>
Question 12
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_m18_qp_32.pdf
