Past-paper question · 2019 October-November · Paper 13 · Q6(a)(iii)

Question 6(a)(iii) 2019 · October-November · Paper 13 · 1 mark

Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Original past-paper question for 6(A)(III)
Reveal official mark-scheme answer Official mark-scheme answer for 6(A)(III)

Official answer for Question 6

Part (a)

(iii)

Question 14

Question 1

Mark scheme 9608_w19_ms_13.pdf →

Show text version of question

Question 6

Part (a)

(iii)

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>

(iii)

Identify the line number of the JavaScript code that takes data the user has input and

stores it in a variable.

.....................................................................................................................................

[1]

Question 13

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Programming basics

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

Keep practising this topic