Question 6(b) 2019 · October-November · Paper 13 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (b)
Question 1
mark per bullet point to max 4
Question 4
Show text version of question
Question 6
Part (b)
Question 6
Willow is creating a website.
One of the web pages includes the following JavaScript code and HTML tags.
01 <html> 02 <body> 03 <form> 04 <p id="displayQuestion"></p> 05 <input type="text" id="answer"> 06 <button id="submit" onclick="checkAnswer()"> Submit </button> 07 </form> 08 </body> 09 <script> 10 val1 = Math.floor((Math.random() * 10) + 1); 11 val2 = Math.floor((Math.random() * 10) + 1); 12 document.getElementById("displayQuestion").innerHTML = "What is" + val1.toString() + "*" + val2.toString() + "?"; 13 function checkAnswer(){ 14 userAnswer = document.getElementById("answer").value; 15 answer = val1 * val2 16 if (userAnswer == answer.toString()){ 17 alert("Correct, well done"); 18 }else{ 19 alert("Sorry that's incorrect"); 20 } 21 } 22 </script> 23 </html>
Part (b)
Willow used functions from a JavaScript program library in the web page.
Describe the benefits to Willow of using program libraries to create the web page.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 14
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 9608_w19_qp_13.pdf
