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

31 questions · page 1 of 3 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
0478/22/F/M/26 · Question 1Feb/March 2026Paper 221 marks
Loading question…
Question text

1
Tick (3) one box to identify the reason for applying a verification check to input data.
A
To make sure that all the data is in the correct range.
B
To make sure that all the data is accurate.
C
To make sure that no errors have been introduced during input.
D
To make sure that all the data is of the correct length.
[1]

2
0478/22/F/M/26 · Question 2Feb/March 2026Paper 2211 marks
Loading question…
Question text

2
(a) Identify the type of validation check in each description. Each check must be different.
(i)
A check to make sure that data input follows a set pattern such as two letters followed
by three numbers.
… [1]
(ii)
A check to make sure that only whole numbers can be input.
… [1]
(b) Explain the reasons why validation checks are necessary when data is input.
…
…
…
…
…
… [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 to meet the following criteria:
•
Input 20 numbers, one at a time.
•
If a number is negative, store it in the current element of array NegNumbers[]
•
If a number is not negative, ask for it to be input again until a negative number is input.
•
When all 20 negative numbers have been stored, output a message to state the check
has been completed.
Use appropriate input prompts and output messages to make the requirements clear to
the user.
Do not declare any arrays or variables for this algorithm.
…
…
…
…
…
…
…
…
…
…
…
… [6]
© Cambridge University P

3
0478/22/F/M/26 · Question 3Feb/March 2026Paper 226 marks
Loading question…
Question text

3
The program development life cycle is split into a number of stages.
Describe what happens during the analysis and design stages of the program development
life cycle.
analysis …
…
…
…
…
…
design …
…
…
…
…
…
[6]

Advertisement
4
0478/22/F/M/26 · Question 6Feb/March 2026Paper 2211 marks
Loading question…
Question text

6
This flowchart represents an algorithm.
START
INPUT
Sentence
SentLength
LENGTH(Sentence)
LetterNo
1
Start
1
IS
Yes
SUBSTRING(Sentence,
LetterNo, 1) = " "
?
Word
SUBSTRING(Sentence,
Start, LetterNo – Start)
No
OUTPUT Word, " ",
LENGTH(Word)
Start
LetterNo + 1
LetterNo
LetterNo + 1
Yes
Word
SUBSTRING(Sentence,
No
IS LetterNo =
Start, LetterNo – Start + 1)
SentLength ?
OUTPUT Word, " ",
LENGTH(Word)
STOP
© Cambridge University Press & Assessment 2026
,
,
(a) Complete the trace table for the algorithm, using the given sentence.
Note: the start position of the sentence is index 1.
Sentence
SentLength
LetterNo
Start
Word
OUTPUT
Computing is fun
16
[5]
(b) Explain the purpose of the algorithm shown by the flowchart.
…
…
…
…
…
… [3]
© Cambridge University Press & Assessment 2026
,
,
(c) As currently written, the algorithm may be difficult to understand if it was used as a program.
Identify three improvements that could be made to the algorithm to make it more
user friendly.
…
…
…
…
…
… [3]
© Cambridge University Press & Assessment 2026

5
0478/22/F/M/25 · Question 1Feb/March 2025Paper 221 marks
Loading question…
Question text

1
Tick (✓) one box to complete this sentence.
A standard method of solution used to find a piece of data in an array is a
A
bubble sort.
B
counting routine.
C
linear search.
D
selection search.
[1]

6
0478/22/F/M/25 · Question 3Feb/March 2025Paper 224 marks
Loading question…
Question text

3
Four development life cycle stages and five descriptions are shown.
Draw one line from each stage to the most appropriate description.
Not all descriptions will be used.
Stage
Description
identifying the problem and requirements
testing
reviewing the final solution to suggest further
developments
analysis
making sure the program code works as expected
coding
using structure diagrams, flowcharts and pseudocode to
plan the solution
design
using a programming language to create the solution
[4]
ĬÍĊ®Ġ´íÈõÏĪÅĊßû¸þ×

7
0478/22/F/M/25 · Question 4Feb/March 2025Paper 227 marks
Loading question…
Question text

4
(a) A presence check is a type of validation check.
State the purpose of a presence check.
…
… [1]
(b) A value input into a computer system must be an integer.
(i)
Identify the validation check used to test whether the value input meets this requirement.
… [1]
(ii)
Write the pseudocode for an algorithm to allow a number to be input into an appropriate
variable and check whether the number is an integer. If the number is an integer, it is
accepted. If the number is not an integer, an error message is output. Re-input of the
number is required until a valid number is input.
…
…
…
…
…
…
…
…
…
… [5]
ĬÏĊ®Ġ´íÈõÏĪÅĊßù¸þ×

8
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]

Advertisement
9
0478/22/F/M/25 · Question 7Feb/March 2025Paper 2210 marks
Loading question…
Question text

7
This flowchart represents an algorithm.
START
OUTPUT
"Continue?"
INPUT Answer
No
Yes
IS Answer =
'Y' ?
INPUT
Value1
STOP
INPUT
Operator
INPUT
Yes
IS Operator =
Value2
'A' ?
OUTPUT
Value1 +
No
Value2
Yes
IS Operator =
'S' ?
OUTPUT
Value1 –
No
Value2
Yes
No
IS Operator =
'M' ?
OUTPUT
OUTPUT
Value1 *
Value1 /
Value2
Value2
ĬÑĊ®Ġ´íÈõÏĪÅĊàùµþ×
,
,
(a) Complete the trace table for the input data:
Y, 7, S, 9, Y, 5, M, 12, Y, 25, D, 5, N, 10, A, 6
Answer
Value1
Operator
Value2
OUTPUT
[5]
(b) State the purpose of the algorithm on page 6.
… [1]
(c) There are problems with the given algorithm. If the lower-case letter ‘y’ is entered for Answer,
the algorithm stops and if a lower-case letter is entered for Operator, the algorithm gives an
incorrect output.
(i)
Explain how you would change the algorithm to prevent the problems described.
…
…
…
…
…
… [3]
(ii)
Identify one more error related to inputs when the algorithm is run.
…
… [1]
ĬÓĊ®Ġ´íÈõÏĪÅĊàûµþ×

10
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]

11
0478/22/F/M/24 · Question 2Feb/March 2024Paper 228 marks
Loading question…
Question text

2
(a) Four test data types and five descriptions are shown.
Draw one line to link each test data type to its most appropriate description.
Test data type
Description
abnormal
a value that is accepted
a value that is the highest or lowest value to be accepted and
the corresponding lowest or highest value to be rejected
boundary
a value that is the highest or lowest value to be rejected
extreme
a value that is rejected
a value that is the highest or lowest value to
be accepted
normal
[4]
(b) An algorithm has been written to test if an integer that is input is in the range 5 to 10 inclusive.
Identify an example of suitable test data for each test data type.
Abnormal …
…
Boundary …
…
Extreme …
…
Normal …
…
[4]

12
0478/22/F/M/24 · Question 3Feb/March 2024Paper 228 marks
Loading question…
Question text

3
A linear search and a bubble sort are standard methods of solution.
Fifty numbers are already stored in the array Values[1:50]
(a) Write an algorithm in pseudocode to input a number, MyNumber, and use a linear search to
test if that number is stored in the array. If the number is found in the array, the position in the
array is output. If the number is not found in the array, “Not found” is output.
…
…
…
…
…
…
…
…
…
…
…
…
… [4]
(b) Write an algorithm in pseudocode to sort the array Values[1:50] into ascending order
using a bubble sort.
…
…
…
…
…
…
…
…
…
…
…

13
0478/22/F/M/24 · Question 5Feb/March 2024Paper 2210 marks
Loading question…
Question text

5
An algorithm has been written in pseudocode to calculate the profit when an item is sold. Values
for cost price and selling price are input, the profit is calculated (selling price – cost price) and
output. The input of zero for either value stops the algorithm.
01 REPEAT
02
OUTPUT "Enter cost price "
03
INPUT Cost
04
OUTPUT "Enter selling price "
05
OUTPUT Sell
06
IF Cost <> 0 OR Sell <> 0
07
THEN
←
Sell - Cost
08
Profit
09
OUTPUT "Profit is ", Profit
10
NEXT
11 UNTIL Cost = 0 OR Sell = 0
(a) Identify the line numbers of three errors in the pseudocode and suggest corrections.
Error 1 line number …
Correction …
…
Error 2 line number …
Correction …
…
Error 3 line number …
Correction …
…
[3]
(b) This algorithm needs to be improved with a range check.
(i)
Write pseudocode to reject the input of values less than zero for variables Cost and
Sell
…
…
…
…
…
…
…
…
…
…
…
…
…
… [3]
(ii)
Des

Advertisement
14
0478/22/F/M/24 · Question 8Feb/March 2024Paper 224 marks
Loading question…
Question text

8
This flowchart represents an algorithm to find the average size of groups of visitors to an attraction.
START
NumberGroups
0
Total
0
INPUT
GroupSize
IS
Yes
GroupSize
Average
DIV(Total, NumberGroups)
= 0?
No
OUTPUT
"Average group
NumberGroups
NumberGroups + 1
size ", Average
Total
Total + GroupSize
STOP
Complete the trace table using this data:
7, 10, 2, 8, 3, 9, 0, 6
NumberGroups
Total
GroupSize
Average
OUTPUT
[4]

15
0478/22/F/M/23 · Question 3Feb/March 2023Paper 223 marks
Loading question…
Question text

3
Describe the purpose of test data. Include an example of a type of test data in your answer.
Description …
…
…
…
Example …
…
[3]

Advertisement