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

Question 6(b) 2019 · October-November · Paper 13 · 4 marks

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

Official answer for Question 6

Part (b)

Question 1

mark per bullet point to max 4

Question 4

✓
•
✓
Using program libraries saves time
✓
•
✓
« as she does not have to write some routines
✓
•
✓
Program library routines should already be thoroughly tested
✓
•
✓
« so, Willow can use them without having to spend time checking they
✓
work / correcting errors
✓
•
✓
Program library routines may perform complex tasks
✓
•
✓
... so, Willow won’t have to work out how to code them
✓
9608/13
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November
✓
PUBLISHED
✓
2019
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w19_ms_13.pdf →

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.

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

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

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

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

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

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

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

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

[4]

Question 14

Topic relevance

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

Keep practising this topic