Past-paper question · 2017 October-November · Paper 32 · Q11

Question 11 2017 · October-November · Paper 32 · 6 marks

Original past-paper question for 11
Reveal official mark-scheme answer

The answer for this question is in the official mark scheme: open the mark scheme.

Mark scheme 9626_w17_ms_32.pdf →

Show text version of question

Question 11

A
shop is open between 12 noon and 10 pm.

While the shop is closed in the morning, a message saying “Sorry, we are closed” is displayed. After the shop has closed in the evening a message saying “Please try again tomorrow” is displayed. At all other times, a message saying, “Hello, we are open now” is displayed.

JavaScript code can be used to alter web pages in real time.

Complete the code in the function below that will allow a user to find out if the shop is open or closed.

function OpenTimesFunction() { var welcome; var timenow = new Date().getHours();

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

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

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

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

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

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

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

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

document.getElementById(“open”).innerHTML = welcome; //This line displays the result of the code }

[6]

Question 15

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_w17_qp_32.pdf

Keep practising this topic