Algorithm design and problem-solving – A Level Computer Science (9618)

35 questions · page 1 of 3

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

1
Study this pseudocode:
3 TO 12 STEP 3
FOR i
OUTPUT i, i * i
NEXT i
(a) Identify the type of construct used in this pseudocode.
… [1]
(b) State how many iterations are performed by this pseudocode.
… [1]
© Cambridge University Press & Assessment 2026

2
9618/21/M/J/26 · Question 4May/June 2026Paper 214 marks
Loading question…
Question text

4
An algorithm is expressed as:
•
A user inputs a sequence of integer values.
•
The process will calculate the number of positive integers.
•
The user will input value 0 to indicate there are no more numbers to be input.
•
Output the number of positive integers after the terminating 0 is input.
Write a structured English description for this algorithm as a sequence of steps.
Do not include pseudocode statements in your description.
Your answer might not require all six steps shown.
step 1 …
…
step 2 …
…
step 3 …
…
step 4 …
…
step 5 …
…
step 6 …
…
[4]
© Cambridge University Press & Assessment 2026

3
9618/22/M/J/26 · Question 2May/June 2026Paper 225 marks
Loading question…
Question text

2
A new computer system is being developed to help manage a tool hire business. A customer can
specify if they want to hire a tool for either half a day or a full day.
An abstract model for the new system is required.
(a) Explain the purpose of abstraction.
…
… [1]
(b) State four items of data that must be stored each time a tool is hired.
item 1 …
item 2 …
item 3 …
item 4 …
[2]
(c) The computer system will have to process the tool hire data. One process is to cancel a tool
hire booking.
State two other processes that would be required.
process 1 …
…
process 2 …
…
[2]
© Cambridge University Press & Assessment 2026

Advertisement
4
9618/23/M/J/26 · Question 1May/June 2026Paper 232 marks
Loading question…
Question text

1
Study the pseudocode.
1
i
REPEAT
OUTPUT i*i
i + 1
i
UNTIL i = 6
(a) Identify the type of programming construct used in the pseudocode.
… [1]
(b) State how many iterations are carried out by the pseudocode.
… [1]
© Cambridge University Press & Assessment 2026

5
9618/23/M/J/26 · Question 4May/June 2026Paper 234 marks
Loading question…
Question text

4
An algorithm is expressed as:
•
A user inputs a sequence of integers.
•
The user will input value –1 to indicate there are no more integers to be input.
•
The program will calculate the total number of integers greater than 120.
•
Output the total number of integers greater than 120 after the –1 terminator is input.
Write a structured English description for this algorithm as a sequence of steps.
Do not include pseudocode statements in your description.
Your answer might not require all six steps shown.
step 1 …
…
step 2 …
…
step 3 …
…
step 4 …
…
step 5 …
…
step 6 …
…
[4]
© Cambridge University Press & Assessment 2026

6
9618/23/M/J/26 · Question 7May/June 2026Paper 239 marks
Loading question…
Question text

7
Study the pseudocode algorithm. Numbers will be copied into the Data array.
// STAGE 1
12
Num1
1
Index
2 TO Num1 DIV 2
FOR i
IF Num1 MOD i = 0 THEN
i
Data[Index]
Index + 1
Index
ENDIF
NEXT i
Index - 1
Index
OUTPUT Index, " values were found"
(a) (i)
Complete the trace table for STAGE 1
Data
Num1
Index
i
1
2
3
4
5
6
[4]
(ii)
State how the numbers in the Data array are related.
… [1]
© Cambridge University Press & Assessment 2026
,
,
(b) The complete algorithm has a second stage.
// STAGE 2
8
Num2
FALSE
Match
REPEAT
IF Num2 MOD Data[Index] = 0 THEN
TRUE
Match
ELSE
Index - 1
Index
ENDIF
UNTIL Match = TRUE OR Index = 0
IF Match = TRUE THEN
OUTPUT Data[Index]
ELSE
OUTPUT "Nothing found"
ENDIF
One line of the STAGE 1 code is changed:
20
Num1
The programmer creates a final program with the STAGE 1 code followed immediately by
the STAGE 2 code.
The STAGE 1 trace table shows the relevant final variable values after the completion
of STAGE 1
STAGE 1
Data
Num1
Num2
Index
Match
1
2
3
4
5
6
20
4
2
4
5
10
This is followed by running of the STAGE 2 code.
© Cambridge University Press & Assessment 2026
,
,
(i)
Complete the trace table for STAGE 2
STAGE 2
Data
Num1
Num2
Index
Match
1
2
3
4
5
6
20
4
2
4
5
10
[3]
(ii)
State the purpose of the STAGE 2 algorithm.
…
… [1]
© Cambridge University Press & Assessment 2026

7
9618/21/O/N/25 · Question 2Oct/Nov 2025Paper 215 marks
Loading question…
Question text

2
Data is a global 1D array containing 30 elements of type STRING
An algorithm will output:
•
all non-blank elements (elements that do not contain an empty string)
•
the final total of the number of elements output.
Complete the program flowchart to represent the algorithm:
START
END
[5]
ĬÕĊ®Ġ´íÈõÏĪÅĊÝû¸Ā×

8
9618/21/M/J/25 · Question 1May/June 2025Paper 2116 marks
Loading question…
Question text

1
A program is being developed to help the manager of a shop control the stock.
(a) An identifier table has been used during the design stage.
Complete the identifier table:
Example value
Explanation
Variable name
Data type
a category of stock
"Fruit"
that is sold in the shop
when an item was
20/02/2025
sold
12.67
the cost of an item
to indicate if an item is
TRUE
in stock
[4]
(b) A module Sales() is part of the stock control program.
The table contains pseudocode extracts from the module Sales()
Each extract may include all or part of:
•
assignment
•
selection
•
iteration (repetition).
Complete the table by placing one or more ticks (✓) in each row:
Pseudocode extract
Assignment
Selection
Iteration
CalculateTotal()
Result
WHILE IsClosed
REPEAT
INPUT Value
UNTIL Sales[4] > Value
IF Sales[Current] <= 150 THEN
TRUE
Discount
ENDIF
CASE OF Option
[5]
ĬÕĊ®Ġ´íÈõÏĪÅĊÞú¸þ×
,
,
(c) Decomposition has been used to design the program to help the shop manager control the
stock.
Describe decomposition.
…
…
…
…
…
… [3]
Ĭ×Ċ®Ġ´íÈõÏĪÅĊÞü¸þ×

Advertisement
9
9618/21/M/J/25 · Question 3May/June 2025Paper 218 marks
Loading question…
Question text

3
A student has been asked to create a simple guessing game program. This program will generate
a random integer value between 1 and 100. It will then repeatedly prompt the user to input an
integer value until they input the randomly generated value.
The student has written a structured English description:
step 1 – randomly generate an integer value between 1 and 100 inclusive
step 2 – prompt the user to input an integer value
step 3 – output an appropriate message if the value input was too high; then repeat from step 2
step 4 – output an appropriate message if the value input was too low; then repeat from step 2
step 5 – output an appropriate message if the value input was the same value that was randomly
generated; then end the program.
Write a pseudocode algorithm from this structured English description.
Assume no input validation is needed.
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
… [8]
ĬÛĊ®Ġ´íÈõÏĪÅĊÝúµþ×

10
9618/21/M/J/25 · Question 4May/June 2025Paper 2128 marks
Loading question…
Question text

4
Study the algorithm:
DECLARE Chars : ARRAY[1:4] OF CHAR
DECLARE I, J : INTEGER
DECLARE Key : CHAR
2
I
'D'
Chars[1]
'T'
Chars[2]
'H'
Chars[3]
'R'
Chars[4]
WHILE I <= 4
//Outer loop
Chars[I]
Key
I – 1
J
WHILE J >= 0 AND Chars[J] > Key
//Inner loop
Chars[J]
Chars[J + 1]
J – 1
J
ENDWHILE
Key
Chars[J + 1]
I + 1
I
ENDWHILE
(a) The outer loop structure used in the algorithm is not the most appropriate one to use.
State the type of loop structure that would be the most appropriate to use and justify why it is
the most appropriate.
Loop structure …
Justification …
…
[2]
ĬÙĊ®Ġ´íÈõÏĪÅĊßüµĀ×
,
,
(b) Complete the trace table by dry running the algorithm.
The first row has been completed.
Chars
I
Key
J
Chars[J]
[1]
[2]
[3]
[4]
2
'D'
'T'
'H'
'R'
[6]
ĬÛĊ®Ġ´íÈõÏĪÅĊßúµĀ×

11
9618/22/M/J/25 · Question 3May/June 2025Paper 228 marks
Loading question…
Question text

3
An algorithm is designed to generate and output two unique random integers. Each integer value
is between –10 and 10 inclusive.
If both integers output are negative, a third random integer between 30 and 35 inclusive will be
generated and output.
Write pseudocode for this algorithm.
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…

12
9618/21/O/N/24 · Question 1Oct/Nov 2024Paper 219 marks
Loading question…
Question text

1
A program will calculate the tax payable based on the cost of an item.
Calculations will occur at many places in the program and these involve the use of one of three tax
rates.
Tax rate values represent a percentage. For example, a tax rate value of 5.23 represents 5.23%.
In this case, the tax payable on an item costing $100 would be $5.23.
Tax rate values are used at several places within the program. One example is given in pseudocode
as follows:
←
HighRate
FALSE
CASE OF ItemCost
← 3.75
<= 50 : TaxRate
// tax rate of 3.75%
← 5.23
<= 200 : TaxRate
// tax rate of 5.23%
← 6.25
> 200 : TaxRate
// tax rate of 6.25%
← TRUE
HighRate
ENDCASE
←
* TaxRate // tax payable
TaxPayable
ItemCost
(a) The pseudocode contains a logical error.
Identify the error and suggest a correction.
Error …
…
Correction …
…
[2]
(b) During the design of the program, tax rate values have been used wherever they are needed
as shown in the pseudocode example above. Tax rates do not change while the program runs.
(i)
Identify a more appropriate way of representing the tax rate values in the final program.
… [1]
(ii)
Describe the benefits of your answer to part (b)(i) with reference to this program.
…
…
…
…
…
… [3]
ĬÕĊ®Ġ´íÈõÏĪÅĊÞü·þ×
,
,
(c) Give the appropriate data type for the variables in the following table, as used in the
pseudocode:
Variable name
Data type
HighRate
TaxPayable
[2]
(d) The final CASE condition (> 200) in the pseudocode example could be replaced with a
keyword.
Give the keyword.
… [1]
Ĭ×Ċ®Ġ´íÈõÏĪÅĊÞú·þ×

13
9618/23/O/N/24 · Question 2Oct/Nov 2024Paper 237 marks
Loading question…
Question text

2
An algorithm will:
1.
prompt and input a sequence of 100 integer values, one at a time
2.
sum the positive integers
3.
output the result of the sum.
(a) Write pseudocode for the algorithm.
Assume the value zero is neither positive nor negative.
You must declare all variables used in the algorithm.
…
…
…
…
…
…
…
…
…
…
…
…
… [5]
(b) The algorithm requires the use of basic constructs. One of these is sequence.
Identify one other basic construct required by the algorithm and describe how it is used.
Construct …
Use …
…
[2]
Ĭ×Ċ®Ġ´íÈõÏĪÅĊÝû·þ×

Advertisement
14
9618/21/M/J/24 · Question 2May/June 2024Paper 217 marks
Loading question…
Question text

2
An algorithm has three steps. It will:
repeatedly input a pair of numeric values A and B
1.
count the number of pairs that are input until A has been greater than B 10 times
2.
3.
output the number of pairs that were input.
(a) Complete the program flowchart.
START
INPUT A, B
Yes
No
END
[5]
(b) Step 1 of the algorithm is changed.
A variable ThisSequence is used to enter a sequence of 10 pairs of numeric values, using
a single input statement.
Following the input of ThisSequence the revised algorithm will extract the pairs of numbers.
Describe the variable ThisSequence and how the numbers are extracted.
…
…
…
… [2]

15
9618/21/M/J/24 · Question 7May/June 2024Paper 2112 marks
Loading question…
Question text

7
A fitness club has a computerised membership system. The fitness club offers a number of
different exercise classes.
The following information is stored for each club member: name, home address, email address,
mobile phone number, date of birth and the exercise(s) they are interested in.
(a) When an exercise class is planned, a new module will send personalised text messages to
each member who has expressed an interest in that exercise. Members wishing to join the
class send a text message back. Members may decide not to receive future text messages
by replying with the message ‘STOP’.
The process of abstraction is used to filter out unnecessary information.
(i)
State one advantage of applying abstraction to this problem.
…
… [1]
(ii)
Identify three items of information that will be required by the new module.
Justify your choices with reference to the given scenario.
Item 1 required …
Justification …
…
Item 2 required …
Justification …
…
Item 3 required …
Justification …
…
[3]
(iii)
Identify two operations that would be required to process data when the new module
receives a text message back from a member.
Operation 1 …
…
Operation 2 …
…
[2]
(b) The structure chart illustrates part of the membership program:
Update
A
P2
T1
Name
P1
Sub-A
Sub-B
Sub-C
Data item notes:
•
Name contains the name of a club member
•
P1 and T1 are of type real.
(i)
Explain the meaning of the diamond symbol (labelled with the letter A) in the chart.
…
…
…
… [2]
(ii)
Write the pseudocode module headers for Sub-A and Sub-B.
Sub-A
…

Advertisement