ocr
Tuesday 18 June 2024 – Afternoon
A Level Computer Science
H446/02 Algorithms and programming
Time allowed: 2 hours 30 minutes
You can use:
a ruler (cm/mm)
an HB pencil
Do not use:
a calculator
Please write clearly in black ink. Do not write in the barcodes.
Centre number Candidate number
First name(s)
INSTRUCTIONS
Last name
• Use black ink. You can use an HB pencil, but only for graphs and diagrams.
• Write your answer to each question in the space provided. If you need extra space use
the lined pages at the end of this booklet. The question numbers must be clearly shown.
• Answer all the questions.
INFORMATION
• The total mark for this paper is 140.
• The marks for each question are shown in brackets [ ].
• Quality of extended response will be assessed in questions marked with an asterisk (*).
• This document has 32 pages.
ADVICE
• Read each question carefully before you start your answer.
Turn over
approved
,approved
, 2
Section A
1 A student has written this pseudocode algorithm:
01 a = 12
02 do
03 b = input("Enter a number")
04 until b >= 0 and b <= 100
05 for c = 1 to a
06 print(c * a)
07 next c
(a) The program uses variables.
(i) Describe what is meant by a variable.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
................................................................................................................................................... [2]
(ii) Give the identifiers of all the variables used in this program.
................................................................................................................................................... [1]
(b) The student has used a do loop on line 02.
Describe the difference between a do loop and a while loop.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[2]
approved
, 3
(c) Rewrite lines 05 to 07 to use a while loop instead of a for loop.
You should write your answer using either program code or pseudocode.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
................................................................................................................................................... [4]
approved Turn over
Tuesday 18 June 2024 – Afternoon
A Level Computer Science
H446/02 Algorithms and programming
Time allowed: 2 hours 30 minutes
You can use:
a ruler (cm/mm)
an HB pencil
Do not use:
a calculator
Please write clearly in black ink. Do not write in the barcodes.
Centre number Candidate number
First name(s)
INSTRUCTIONS
Last name
• Use black ink. You can use an HB pencil, but only for graphs and diagrams.
• Write your answer to each question in the space provided. If you need extra space use
the lined pages at the end of this booklet. The question numbers must be clearly shown.
• Answer all the questions.
INFORMATION
• The total mark for this paper is 140.
• The marks for each question are shown in brackets [ ].
• Quality of extended response will be assessed in questions marked with an asterisk (*).
• This document has 32 pages.
ADVICE
• Read each question carefully before you start your answer.
Turn over
approved
,approved
, 2
Section A
1 A student has written this pseudocode algorithm:
01 a = 12
02 do
03 b = input("Enter a number")
04 until b >= 0 and b <= 100
05 for c = 1 to a
06 print(c * a)
07 next c
(a) The program uses variables.
(i) Describe what is meant by a variable.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
................................................................................................................................................... [2]
(ii) Give the identifiers of all the variables used in this program.
................................................................................................................................................... [1]
(b) The student has used a do loop on line 02.
Describe the difference between a do loop and a while loop.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[2]
approved
, 3
(c) Rewrite lines 05 to 07 to use a while loop instead of a for loop.
You should write your answer using either program code or pseudocode.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
................................................................................................................................................... [4]
approved Turn over