Programming – IGCSE Computer Science (9–1) (0984)

25 questions · page 1 of 2 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
0984/21/M/J/26 · Question 2May/June 2026Paper 214 marks
Loading question…
Question text

2
Identify four operators that are not arithmetic operators from the list.
/
>
<=
+
*
^
AND
DIV
MOD
NOT
1 …
2 …
3 …
4 …
[4]

2
0984/21/M/J/26 · Question 3May/June 2026Paper 213 marks
Loading question…
Question text

3
Complete the table by writing the most appropriate data type for each variable described.
variable
description
example data
data type
Age
16
the age of the student
the telephone number of
TelephoneNumber
+44 7846398573
the student
whether the student is a
Teenager
TRUE
teenager or not
[3]
© Cambridge University Press & Assessment 2026

3
0984/21/M/J/26 · Question 4May/June 2026Paper 2154 marks
Loading question…
Question text

4
The following pseudocode algorithm uses a bubble sort to sort the array Names[50]
Complete the algorithm.
…
Last
REPEAT
…
Swap
1 TO Last ‑ 1
FOR …
IF Names[Index] > Names[Index + 1]
THEN
Names[Index]
Temp
Names[Index + 1]
Names[Index]
Temp
Names[Index + 1]
TRUE
Swap
ENDIF
NEXT Index
Last ‑ 1
Last
UNTIL … Swap OR Last = 1
[4]
© Cambridge University Press & Assessment 2026

Advertisement
4
0984/21/M/J/26 · Question 5May/June 2026Paper 2112 marks
Loading question…
Question text

5
A computer system automatically creates usernames for new users. A new user enters their first
name and their last name.
The system:
•
takes the first letter of the first name
•
takes the first two letters of the last name
•
converts all the letters to upper case
•
generates a random whole number between 1 and 1000 inclusive.
For the following example:
The first name is Muhammed
The last name is Hann
The generated number is 492
The username will be MHA492
(a) Write the pseudocode to generate a whole random number between 1 and 1000 inclusive
and store it in the variable GeneratedNumber
…
…
… [2]
(b) The last name is input into the variable LastName
Write the pseudocode to:
•
take the first two letters from LastName
•
convert the letters to upper case
•
store the result in the variable Temp
…
…
… [3]
(c) The new username is stored in the variable NewUsername
Write the pseudocode to store NewUsername to the file Username.txt
…
…
…
… [3]
© Cambridge University Press & Assessment 2026
,
,
(d) Identify and describe verification checks that could be applied to the inputs of the first name
and the last name of the user.
…
…
…
…
…
… [4]

5
0984/21/M/J/26 · Question 6May/June 2026Paper 214 marks
Loading question…
Question text

6
Give programming examples for a count‑controlled loop and a post‑condition loop.
Describe each of the loops.
count‑controlled loop example …
description …
…
…
post‑condition loop example …
description …
…
…
[4]
© Cambridge University Press & Assessment 2026

6
0984/21/M/J/26 · Question 7May/June 2026Paper 214 marks
Loading question…
Question text

7
An algorithm has been written in pseudocode for a user to repeatedly input positive whole
numbers and store them in an array called Values[] until –1 is input or until the array is full.
The algorithm outputs the average of the numbers to 2 decimal places.
01
DECLARE Counter : INTEGER
02
DECLARE Total : INTEGER
03
DECLARE Average : INTEGER
04
DECLARE Values : ARRAY[1:100] OF INTEGER
1
05
Counter
0
06
Total
07
OUTPUT "Please enter a positive whole number or ‑1 "
08
INPUT Number
09
WHILE Number = ‑1 AND Counter <= 100 DO
Number
10
Values[Counter]
Total + 1
11
Total
Counter + 1
12
Counter
13
INPUT Number
14
ENDWHILE
Counter ‑ 1
15
Counter
Counter / Total
16
Average
17
OUTPUT "The average is ", ROUND(Average, 2)
Identify the line numbers of four errors in the pseudocode and suggest a correction for
each error.
error 1 line number …
correction …
…
error 2 line number …
correction …
…
error 3 line number …
correction …
…
error 4 line number …
correction …
…
[4]
© Cambridge University Press & Assessment 2026

7
0984/21/M/J/26 · Question 11May/June 2026Paper 215 marks
Loading question…
Question text

11
The function Power(FirstNumber, SecondNumber) returns the value of FirstNumber
raised to the power of SecondNumber. FirstNumber and SecondNumber are integers.
Write pseudocode statements to:
•
define the function
•
call the function with the variables A and B and store the return value in the variable Value
function definition
…
…
…
…
…
…
function call
…
…
[5]
© Cambridge University Press & Assessment 2026

8
0984/21/M/J/26 · Question 12May/June 2026Paper 2115 marks
Loading question…
Question text

12 A weather monitoring station records the number of minutes of sunshine for each day of a month.
The one‑dimensional (1D) array Sunshine[] is used to store the number of minutes of sunshine
for each day. The index of the array represents the day.
The one‑dimensional (1D) array MonthDays[] contains the number of days in each month. The
index of the array represents the month. In this array, 28 is stored in index 2 for the month of
February. However, there are 29 days in February in a leap year.
In this program, a leap year is a year that divides by 4 with no remainder. For example, 2026 is
not a leap year but 2028 will be a leap year.
Write a program that meets the following requirements:
•
allows the user to input a year, calculates whether it is a leap year and updates the number
of days in February as appropriate
•
allows a user to input the name of one of the first three months of the year: January,
February or March
•
allows a user to input the number of minutes of sunshine for each day of the month and
validates the input
•
calculates the total amount of sunshine for the month in hours and minutes
•
finds the highest amount of daily sunshine for the month
•
outputs the:
◦
year
◦
month
◦
total amount of sunshine for the month in hours and minutes
◦
the highest amount of daily sunshine for the month.
You must use pseudocode or program code and add comments to explain how your code works.
Do not declare any arrays or variables; assume that this has already been done.
All inputs and outputs must contain suitable messages.
…
…
…
…
…
…
…
…
…
…
…
© Cambridge University Press & Assessment 2026
,
,
…
…
…
…
…

Advertisement
9
0984/22/M/J/26 · Question 1May/June 2026Paper 221 marks
Loading question…
Question text

1
Tick (3) one box to complete the following sentence.
Two types of pseudocode statements used for iteration are
A
CASE and IF
B
FOR … NEXT and IF
C
FOR … NEXT and WHILE … DO … ENDWHILE
D
REPEAT … UNTIL and CASE
[1]

10
0984/22/M/J/26 · Question 2May/June 2026Paper 221 marks
Loading question…
Question text

2
Tick (3) one box to identify a programming data type used to store a single letter, symbol or
number input from the keyboard.
A
Boolean
B
char
C
integer
D
real
[1]

11
0984/22/M/J/26 · Question 3May/June 2026Paper 2211 marks
Loading question…
Question text

3
(a) Identify the type of validation check used in each description.
(i)
A check to make sure that data has been input and not left blank.
… [1]
(ii)
A value placed at the end of a sequence of numbers in the code. The value is calculated
from all the other values before it.
… [1]
(b) Explain the purpose of a format check and give an example of where it could be used.
purpose …
…
…
…
…
example …
…
[3]
© Cambridge University Press & Assessment 2026
,
,
(c) Write the pseudocode for an algorithm to perform a validation check on each number as it is
input, using the following criteria:
•
Input one number at a time.
•
If the number is a whole number, store it in the current element of array Accepted[]
•
If the number is not a whole number, ask for it to be input again until it is a
whole number.
•
When 15 whole numbers have been stored, output a message that states the check has
been completed.
Use appropriate input prompts and output messages to make the requirements clear to
the user.
You do not need to declare any arrays or variables for this algorithm.
…
…
…
…
…
…
…
…
…
…
…
…

12
0984/22/M/J/26 · Question 5May/June 2026Paper 2210 marks
Loading question…
Question text

5
The purpose of this pseudocode algorithm is to find the name of a customer using an account ID,
which contains letters and numbers. The name of the customer and the account ID are stored in
the prepopulated two-dimensional (2D) array Accounts[]. The algorithm would then output the
name of the customer.
For example, Accounts[1, 1] contains the account ID of the first customer and
Accounts[1, 2] contains the name of the first customer.
01
DECLARE Accounts : ARRAY[1:1000, 1:2] OF STRING
02
DECLARE Row : INTEGER
03
DECLARE AccountID : INTEGER
04
OUTPUT "Please enter an account ID "
05
OUTPUT AccountID
1 TO 1000
06
FOR Row
07
CASE OF AccountID = Accounts[Row, 1]
08
THEN
09
OUTPUT "The customer’s name is ", Accounts[1, 2]
10
ENDIF
11
NEXT Row
(a) Identify the line numbers of four errors in the pseudocode and suggest corrections.
error 1 line number …
correction …
…
error 2 line number …
correction …
…
error 3 line number …
correction …
…
error 4 line number …
correction …
…
[4]
(b) State the name given to this type of algorithm.
… [1]
© Cambridge University Press & Assessment 2026
,
,
(c) The algorithm stops if the account number is not found in the array.
Write the pseudocode statements to change the algorithm to inform the user that the
account number has not been found in the array.
Clearly state where in the original algorithm your new statements would be placed.
Do not rewrite the whole algorithm.
…
…
…
…
…
…
…
…
…

13
0984/22/M/J/26 · Question 6May/June 2026Paper 227 marks
Loading question…
Question text

6
This flowchart represents an algorithm.
START
INPUT Word
WordLength
LENGTH (Word)
0
Count
1
NumLetter
IS SUBSTRING(Word, NumLetter, 1)
Yes
= SUBSTRING(Word, NumLetter + 1
, 1) ?
Count
Count + 1
No
NumLetter
NumLetter + 1
IS
OUTPUT Count
Yes
No
NumLetter =
WordLength
?
INPUT Choice
Yes
Is Choice =
'Y' ?
No
STOP
© Cambridge University Press & Assessment 2026
,
,
(a) Complete the trace table for the algorithm, using the input data:
post, Y, committee, N, bookkeeper
Note: the first character of each word is in position 1.
Word
WordLength
Count
NumLetter
Choice
OUTPUT
[6]
(b) State the purpose of the algorithm shown by the flowchart.
…
… [1]
© Cambridge University Press & Assessment 2026

Advertisement
14
0984/22/M/J/26 · Question 7May/June 2026Paper 225 marks
Loading question…
Question text

7
(a) State one reason to store data in a file.
…
… [1]
(b) A list of names of the members of a club are stored in a file called Names.txt
Write the pseudocode statements to load a line of text from Names.txt and assign the line
of text to an appropriately named variable.
…
…
…
…
…
…
…
… [4]
© Cambridge University Press & Assessment 2026

15
0984/22/M/J/26 · Question 10May/June 2026Paper 2215 marks
Loading question…
Question text

10 A program is required to record and analyse the daily rainfall in millimetres for one year. Assume
a year has 365 days.
The one-dimensional (1D) array Rainfall[] is used to store the daily rainfall measurements.
Write a program for the following requirements:
•
Initialise the array Rainfall[] to zero.
•
Input the rainfall measurement in millimetres for each day and store it in the array.
•
Calculate the following statistics after all the inputs have been made for the year:
◦
the total rainfall for the year in centimetres (1 centimetre = 10 millimetres), rounded to
two decimal places
◦
the mean average daily rainfall in millimetres, rounded to four decimal places
◦
the total number of days with no rainfall
◦
the longest number of consecutive days in which there was no rainfall.
•
Output all the calculated statistics with clear and appropriate messaging.
•
If the longest number of consecutive days in which there was no rainfall is 15 or more,
output a message to indicate there was a drought (a long period when there is little or
no rainfall).
You must use pseudocode or program code and add comments to explain how your code works.
All arrays, variables or constants used must be declared for this algorithm.
All inputs and outputs must contain suitable messages.
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
© Cambridge University Press & Assessment 2026
,
,
…
…
…

Advertisement