Programming for the web – A Level Information Technology (9626)

23 questions · page 1 of 2 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
9626/32/O/N/25 · Question 10Oct/Nov 2025Paper 326 marks
Loading question…
Question text

10 JavaScript code can be executed when an HTML event happens in a web browser. An example of
an HTML event is when a user clicks a mouse button.
(a) Describe how the JavaScript in this HTML code changes the display of text on the web page
when a mouse button is clicked.
The line numbers are included for reference only.
1
<html>
2
<body>
3
4
<h2>Cambridge International JS Code: HTML Event</h2>
5
<h2 onclick="changeText(this)">Click on this line to see the name
of this 9626 QP</h2>
6
7
<script>
8
function changeText(id) {
9
id.innerHTML = "A Level IT Paper 3";
10
}
11
</script>
12
13 </body>
14 </html>
…
…
…
…
…
…
…
…
…
… [4]
(b) Describe two other HTML events that can be used to trigger the execution of JavaScript
code.
…
…
…
…
…
… [2]
ĬÛú¾Ġ´íÈõÏĪÅĊàü·þ×

2
9626/33/O/N/25 · Question 5Oct/Nov 2025Paper 337 marks
Loading question…
Question text

5
Message switching can be used in networks to transfer data between devices.
(a) Describe how message switching transfers data between devices.
…
…
…
…
…
…
…
… [3]
(b) Explain why message switching is used to transfer data.
…
…
…
…
…
…
…
…
… [4]
ĬÙú¾Ġ´íÈõÏĪÅĊßüµþ×

3
9626/33/O/N/25 · Question 7Oct/Nov 2025Paper 336 marks
Loading question…
Question text

7
The JavaScript code in Fig. 7.1 is executed when it is loaded into a web browser.
The line numbers are for reference only.
1
<html>
2
<body>
3
4
<p id="ALP3"></p>
5
6
<script>
7
8
const qp = ["A Level", "IT", "9626", "Paper", 3];
9
10
let paper = "";
11
for (let x in qp) {
12
paper += qp[x] + "<BR>";
13
}
14
15
document.getElementById("ALP3").innerHTML = paper;
16
17
</script>
18
19
</body>
20
</html>
Fig. 7.1
Explain how the code produces the list shown in Fig.7.2.
File | M:/CIE/202...
A Level
IT
9626
Paper
3
Fig. 7.2
ĬÙú¾Ġ´íÈõÏĪÅĊÝüµĀ×
,
,
…
…
…
…
…
…
…
…
…
…
…
…
…
… [6]
ĬÛú¾Ġ´íÈõÏĪÅĊÝúµĀ×

Advertisement
4
9626/33/O/N/25 · Question 8Oct/Nov 2025Paper 336 marks
Loading question…
Question text

8
In computer animation, objects can be made to appear to move at different speeds.
Describe how an animator can control the speed at which objects appear to move.
…
…
…
…
…
…
…
…
…
…
…
…
…
… [6]

5
9626/32/O/N/24 · Question 1Oct/Nov 2024Paper 326 marks
Loading question…
Question text

1
JavaScript uses for loops to run through a block of code.
(a) In JavaScript, the for loop has the following syntax:
for (Statement_1; Statement_2; Statement_3){
// block of code to be executed is written here
}
Describe the purpose of each of the three statements:
Statement_1
…
…
…
Statement_2
…
…
…
Statement_3
…
…
…
[3]
(b) Compare the use of a for loop with a for in loop.
…
…
…
…
…
…
…
… [3]
ĬÕú¾Ġ´íÈõÏĪÅĊàû·þ×

6
9626/33/O/N/24 · Question 1Oct/Nov 2024Paper 336 marks
Loading question…
Question text

1
JavaScript can manipulate and store strings in variables.
(a) Define the term string as used in JavaScript.
…
…
… [1]
(b) Describe how a string can be created in JavaScript.
…
…
… [1]
(c) A variable text1 is used to store Cambridge and a variable text2 is used to store
International Examinations in a block of JavaScript code.
(i)
Describe how the two strings can be joined together (concatenated) as Cambridge
International Examinations and stored in a new variable called text3 in a
JavaScript statement.
…
…
…
…
…
… [2]
(ii)
Describe one method by which the word Examinations can be extracted from text3
for use in another variable.
…
…
…
…
…
… [2]
ĬÕú¾Ġ´íÈõÏĪÅĊßû¸þ×

7
9626/31/O/N/23 · Question 2Oct/Nov 2023Paper 317 marks
Loading question…
Question text

2
A company holds special events for selected customers on various dates throughout the year.
Source documents of customer lists are used to create customised invitations by mail merge.
(a) Explain why source documents are proof read manually to try to ensure that the final versions
are accurate and error-free.
…
…
…
…
…
…
…
… [3]
(b) Explain how a merge field can be used to prompt for and insert the date of the special event
in the invitations when they are produced.
…
…
…
…
…
…
…
…
…
… [4]

8
9626/31/O/N/23 · Question 7Oct/Nov 2023Paper 315 marks
Loading question…
Question text

7
(a) Describe each of the following terms when referring to JavaScript statements.
(i)
operand
…
…
… [1]
(ii)
operator precedence
…
…
… [1]
(iii)
assignment operator
…
…
… [1]
(iv)
literals
…
…
… [1]
(b) JavaScript has its own group of reserved keywords which cannot be used as names for
variables, labels or functions.
Describe one other group of reserved words that should not be used when writing JavaScript
code for use on web pages.
…
…
… [1]

Advertisement
9
9626/32/O/N/23 · Question 6Oct/Nov 2023Paper 326 marks
Loading question…
Question text

6
Loops in JavaScript repeatedly execute blocks of code.
(a) Describe how a for loop works in JavaScript code.
…
…
…
…
…
…
…
…
…
… [4]
(b) Contrast the use of while and do while loops in JavaScript code.
…
…
…
…
…
… [2]

10
9626/32/O/N/23 · Question 7Oct/Nov 2023Paper 325 marks
Loading question…
Question text

7
In JavaScript, an object is defined as a collection of properties which can be amended or deleted.
(a) Describe how an object may be given a new property.
…
…
…
… [1]
(b) Describe how the properties of an object in JavaScript can be displayed using a loop.
…
…
…
…
…
…
…
…
…
… [4]

11
9626/32/O/N/22 · Question 9Oct/Nov 2022Paper 3210 marks
Loading question…
Question text

9
A programmer is writing some JavaScript code to display this text on a web page:
This is “Cambridge International IT 9626 Paper 3”
The programmer uses strings in the code.
(a) Describe the purpose of strings in JavaScript.
…
…
… [1]
(b) The programmer’s first attempt at the HTML and JavaScript code is shown in Fig. 9.1. Line
numbers are shown only for your use when referring to the code.
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h2>This is "Cambridge Assessment International Education"</h2>
6
7
<p id="string"></p>
8
9
<script>
10
var x = "This is "Cambridge International IT 9626 Paper 3"";
11
document.getElementById("string").innerHTML = x;
12
</script>
13
14
</body>
15
</html>
Fig. 9.1
When run in a web browser the HTML code outputs the heading in line 5 on the page. The browser
executes the JavaScript code shown in lines 9 to 12.
The expected output of the code on the web page is shown in Fig. 9.2 but the actual output is
shown in Fig. 9.3.
Fig. 9.2
Fig. 9.3
Explain why the error in line 10 prevents the JavaScript code from outputting:
This is “Cambridge International IT 9626 Paper 3”
…
…
…
…
…
…
…
…
…
…
… [4]
(c) JavaScript programmers often wish to control when sections of their code are executed.
Compare the use of setTimeout() and setInterval() for delaying the execution of
JavaScript code.
…
…
…
…

12
9626/31/O/N/21 · Question 2Oct/Nov 2021Paper 318 marks
Loading question…
Question text

2
QR codes are two-dimensional bar codes (matrix bar codes) representing information about items
to which they are attached. An example of a QR code is shown:
(a) Describe the functional elements of a QR code.
…
…
…
…
…
…
…
…
…
…
… [5]
(b) Explain why damaged QR codes may still be read while damaged one-dimensional bar codes
often cannot be read.
…
…
…
…
…
…
… [3]

13
9626/31/O/N/21 · Question 10Oct/Nov 2021Paper 316 marks
Loading question…
Question text

10 JavaScript is an interpreted language that can be used on web pages. Runtime errors, called
exceptions, can occur during the execution of JavaScript code.
Explain how exceptions can be handled during the execution of JavaScript code.
…
…
…
…
…
…
…
…
…
…
…
…
…
… [6]

Advertisement
14
9626/32/O/N/21 · Question 3Oct/Nov 2021Paper 326 marks
Loading question…
Question text

3
JavaScript is a programming language used within HTML on web pages.
Explain why it is considered good practice when coding in JavaScript to:
(a) place all declarations at the start of each script or function
…
…
…
…
…
… [2]
(b) initialise variables when first declared
…
…
…
…
…
… [2]
(c) avoid using eval() to run a string as code
…
…
… [1]
(d) always declare local variables.
…
…
… [1]

15
9626/32/O/N/20 · Question 1Oct/Nov 2020Paper 329 marks
Loading question…
Question text

1
(a) Explain the meanings of these terms when referring to JavaScript objects.
(i)
string
…
…
… [1]
(ii)
global
…
…
… [1]
(iii)
regular expression
…
…
… [1]
(iv)
operator
…
…
… [1]
(v)
statement
…
…
… [1]
(b) Describe, in detail, the use of console.log() in JavaScript to output data for display.
…
…
…
…
…
…
…
…
…
… [4]

Advertisement