Past-paper question · 2017 February-March · Paper 32 · Q9(c)

Question 9(c) 2017 · February-March · Paper 32 · 3 marks

Original past-paper question for 9(C)
Original past-paper question for 9(C)
Original past-paper question for 9(C)
Reveal official mark-scheme answer Official mark-scheme answer for 9(C)

Official answer for Question 9

Part (c)

✓
A suitable line of code would be: var place = city(2)

Question 3

✓
Three from:
✓
var
✓
=1 mark
✓
plus suitable variable name to store city e.g. place
✓
=1 mark
✓
= city(2)
✓
=1 mark
✓
9626 / 32
✓
Cambridge International AS/A Level – Mark Scheme
✓
March 2017
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9626_m17_ms_32.pdf →

Show text version of question

Question 9

Part (c)

Question 9

JavaScript can be embedded in the code of web pages to add interactivity to a page.

Jonas uses JavaScript code to store, list and display the names of cities on a web page.

Part (c)

Jonas wants to extract ‘Oxford’ from the list in the code below to display it on the web page.

var city = ["London", "Cambridge", "Oxford", "Manchester"];

Write a line of JavaScript code to access the list and store the city name.

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

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

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

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

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

...............................................................................................................................................[3]

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

Keep practising this topic