Algorithm design and problem-solving – IGCSE Computer Science (0478)

10 questions

0 / 0Answer a question to start your score.
New quizSaved 0

Quick quiz: 10 random questions from this topic. Answer them all, then open the Summary.

Advertisement
1
0478/21/O/N/21 · Question 3Oct/Nov 2021Paper 2110 marks
Loading question…
Question text

3
A program has been written to check the value of a measurement. The measurement must be a
positive number and given to three decimal places, for example, 3.982
(a) (i)
State suitable examples of normal and erroneous test data that could be used to test this
program. For each example give the reason for your choice of test data.
Normal test data example …
Reason …
…
Erroneous test data example …
Reason …
…
[4]
(ii)
Explain why two pieces of boundary test data are required for this program.
Give an example of each piece of boundary test data.
…
…
…
…
… [3]
(b) Explain why verification is needed and how verification could be performed by this program.
…
…
…
…
…
… [3]
Question 4 starts on Page 12

2
0478/23/O/N/25 · Question 6Oct/Nov 2025Paper 239 marks
Loading question…
Question text

6
The flowchart represents an algorithm.
START
Position
–1
Count
1
INPUT Name
IS Name =
Yes
Position
Count
ClassList[Count]
?
No
Count
Count + 1
No
IS Count
> 5 ?
Yes
OUTPUT
Position
STOP
ĬÑĊ®Ġ´íÈõÏĪÅĊßüµþ×
,
,
(a) The algorithm uses the one-dimensional (1D) array ClassList that contains the following
data:
ClassList
1
2
3
4
5
Henil
Sven
Ella
Asia
Ridwan
Complete the table by writing the output from the flowchart when each of the given names are
input.
Name
OUTPUT
Ridwan
Yan
Ella
[2]
(b) Identify the standard method of solution used by the flowchart.
… [1]
(c) Write the algorithm in pseudocode.
…
…
…
…
…
…
…
…
…
…
…
…
… [6]
ĬÓĊ®Ġ´íÈõÏĪÅĊßúµþ×

3
0478/23/M/J/20 · Question 2May/June 2020Paper 234 marks
Loading question…
Question text

2
Draw a line to connect each Description to the most appropriate Pseudocode example.
Description
Pseudocode example
A loop that will iterate
CASE … OF … OTHERWISE … ENDCASE
at least once
A loop that will not be
Number + 1
Number
executed on the first test
if the condition is false
WHILE … DO … ENDWHILE
A conditional statement
Sum
Sum + NewValue
Totalling
REPEAT … UNTIL
Counting
[4]

Advertisement
4
0478/22/F/M/25 · Question 5Feb/March 2025Paper 226 marks
Loading question…
Question text

5
A program is written to only accept data that contains more than 9 characters. The program needs
to be tested. The table, when completed, shows appropriate test data that matches the type of test
data and the purpose of the test data.
Complete the table by inserting the missing information.
Test data
Type of test data
Purpose of test data
…
ABC
…
…
Boundary
…
to make sure that the program accepts data
that is an appropriate length
[6]

5
0478/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.
…
…
…
…
…
…
…
…
…
…
…
.

6
0478/22/O/N/16 · Question 2Oct/Nov 2016Paper 228 marks
Loading question…
Question text

2
Read this section of program code that inputs positive numbers, discards any negative numbers
and then outputs the average. An input of zero ends the process.
1
Total = 0
2
Counter = 100
3
REPEAT
4
REPEAT
5
INPUT Num
6
UNTIL Num < 0
7
Total = Total + 1
8
Counter = Counter + Num
9
UNTIL Num = 0
10
Average = Total / (Counter - 1)
11
Print Average
There are four errors in this code.
Locate these errors and suggest a correction to remove each error.
Error 1 …
Correction …
…
Error 2 …
Correction …
…
Error 3 …
Correction …
…
Error 4 …
Correction …
… [8]

7
0478/21/O/N/18 · Question 4Oct/Nov 2018Paper 218 marks
Loading question…
Question text

4
An algorithm is written in pseudocode:
0
Total
1 TO 50
FOR Count
INPUT Num
Total + Num
Total
NEXT Count
OUTPUT Total
(a) Describe the purpose of the algorithm.
…
…
…
…
…
… [3]
(b) Re-write the algorithm in pseudocode using a different type of loop.
…
…
…
…
…
…
…
…
…
… [3]
(c) Describe how you could modify the original algorithm shown at the start of question 4, to
allow any number of inputs.
…
…
…
… [2]
Question 5 starts on page 12.

8
0478/23/O/N/23 · Question 5Oct/Nov 2023Paper 239 marks
Loading question…
Question text

5
An algorithm has been written in pseudocode to check if a new password is in a list of previously
used passwords OldList[]
If the password is not found, the new password will be stored at the end of the list to replace
"XXXX" already stored there.
01
OUTPUT "Enter your new password "
02
INPUT NewPassword
1
03
Posn
FALSE
04
Found
05
REPEAT
06
IF Password = OldList[Posn]
07
THEN
TRUE
08
Found
Posn + 1
09
ELSE Posn
10
ENDIF
11
UNTIL Found AND OldList[Posn] = "XXXX"
12
IF Found
13
THEN
14
OUTPUT "Password has been used before"
15
ELSE
16
INPUT "New password accepted"
NewPassword
17
OldList[Posn]
18
ENDIF
(a) Identify the three errors in the pseudocode and suggest corrections.
Error 1 …
Correction …
…
Error 2 …
Correction …
…
Error 3 …
Correction …
…
[3]
(b) Complete this flowchart for the corrected algorithm:
START
STOP
[6]

Advertisement
9
0478/22/F/M/24 · Question 1Feb/March 2024Paper 221 marks
Loading question…
Question text

1
Tick (✓) one box to show which task is part of the analysis stage of the program life cycle.
A
coding
B
decomposition
C
design
D
testing
[1]

10
0478/22/O/N/19 · Question 4Oct/Nov 2019Paper 223 marks
Loading question…
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]

Advertisement