Algorithm design and problem-solving – IGCSE Computer Science (9–1) (0984)
Question text
1
Tick (3) one box to identify the type of validation check to test whether a number entered into a
computer system is between two set values.
A
length check
B
presence check
C
type check
D
range check
[1]
Question text
10 (a) Draw a flowchart to input six whole numbers and output the highest. You do not need to
validate the inputs.
START
[6]
© Cambridge University Press & Assessment 2026
,
,
(b) Describe how the flowchart could be changed to only accept positive whole numbers.
…
…
…
…
…
… [3]
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.
…
…
…
…
…
…
…
…
…
…
…
…
Question text
4
The program development life cycle is split into several stages.
Outline what happens during the coding and testing stages of the program development
life cycle.
coding …
…
…
…
…
…
testing …
…
…
…
…
…
[6]
© Cambridge University Press & Assessment 2026
,
,
© Cambridge University Press & Assessment 2026
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
Question text
2
Tick (3) one box in each row to identify if the statement is about validation, verification or neither.
Validation
Verification
Neither
Statement
(3)
(3)
(3)
a check where data is re-entered to make sure no
errors have been introduced during data entry
an automatic check to make sure the data entered
has the correct number of characters
a check to make sure the data entered is sensible
a check to make sure the data entered is correct
[3]
Question text
3
A program checks that the data entered is between 1 and 100 inclusive.
Identify one piece of normal, extreme and erroneous test data for this program, and give a reason
for each.
Normal test data …
Reason …
…
…
Extreme test data …
Reason …
…
…
Erroneous test data …
Reason …
…
…
[6]
Question text
5
The flowchart represents an algorithm.
The algorithm will terminate if –1 is entered at the List input.
START
← 0
List1
← 0
List2
INPUT
List
IS
Yes
List = –1 ?
No
INPUT
Value
← List1 + Value
Yes
IS
List1
List = 1 ?
No
← List2 + Value
Yes
IS
List2
List = 2 ?
OUTPUT
"List 1 = ", List1
No
OUTPUT
OUTPUT
"Input Error"
"List 2 = ", List2
IS
Yes
List1 > List2 ?
No
OUTPUT
"List 1 is greatest"
OUTPUT
"List 2 is greatest"
END
Complete the trace table for the algorithm using this input data:
2, 77, 2, 16, 1, 35, 2, –7, 5, 18, 1, 11, 1, 12, 2, 20, –1, 18
List
Value
List1
List2
OUTPUT
[5]
Question text
Tick ( ü ) one box in each row to identify if the statement about structure diagrams is true or false.
2
False
True
Statement
( ü )
( ü )
A structure diagram is a piece of code that is available throughout the
structure of a program.
A structure diagram shows the hierarchy of a system.
A structure diagram is another name for an array.
A structure diagram shows the relationship between different components
of a system.
[2]
Question text
3
Programs can perform validation and verification checks when data is entered.
(a) Give the names of two different validation checks and state the purpose of each one.
Check 1 …
Purpose …
…
…
Check 2 …
Purpose …
…
…
[4]
(b) Give the name of one verification check.
… [1]
(c) Describe the difference between validation and verification.
…
…
…
… [2]
Question text
5
The flowchart represents an algorithm.
The predefined function DIV gives the value of the result of integer division,
←
9 DIV 4 gives y a value of 2
for example, y
An input value of –1 ends the algorithm.
START
INPUT
Value
IS
Yes
Value =
-1 ?
No
Calc1
Value DIV 2
Calc2
Value DIV 3
IS
No
Calc1 =
Value / 2 ?
Yes
IS
No
Calc2 =
Value / 3 ?
Yes
OUTPUT
Value
END
(a) Complete the trace table for the input data:
50, 33, 18, 15, 30, –1, 45, 12, 90, 6
Value
Calc1
Calc2
OUTPUT
[4]
(b) Describe the purpose of the algorithm.
…
…
… [2]
Question text
3
(a) The flowchart checks the lengths of a batch of 10 ropes. For the batch to be accepted 90% of
the lengths need to be between 24.9 and 25.1 metres.
START
Reject
0
Count
0
Yes
Is Count =
10 ?
No
No
Is Reject
Count
Count + 1
<= 1 ?
INPUT Length
Yes
OUTPUT "Batch
rejected"
Is Length <
Yes
25.1 AND
Length > 24.9 ?
No
Reject
Reject + 1
OUTPUT "Batch
accepted"
END
Complete the trace table for the input data:
24.88, 25.01, 24.98, 25.00, 25.05, 24.99, 24.97, 25.04, 25.19, 25.07
Reject
Count
Length
OUTPUT
[4]
(b) (i)
It has been decided to only reject batches of rope that contain ropes that are too short.
State the change required to the algorithm.
…
… [1]
(ii)
Explain how the algorithm to reject batches could be improved to make it more effective.
…
…
…
… [2]
Question text
4
Four validation checks and four descriptions are shown.
Draw a line to connect each validation check to the correct description.
Validation Check
Description
Checks that some data is entered.
Range check
Checks for a maximum number of characters
Presence check
in the data entered.
Checks that the characters entered are all
Length check
numbers.
Checks that the value entered is between an
Type check
upper value and a lower value.
[3]
Question text
5
A programmer writes a program to weigh baskets of fruit in grams, keeping a total of the weight
and counting the number of baskets. The total weight is stored in a variable Total and the number
of baskets is stored in a variable BasketCount.
Explain, including examples of programming statements, how totalling and counting could be used
in this program.
Totalling …
…
…
…
…
…
Counting …
…
…
…
…
…
[4]