Algorithm design and problem-solving – IGCSE Computer Science (0478)
199 questions · page 1 of 14 · Clear filters
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
1
Tick (3) one box to complete this sentence.
A standard method of solution used for adding together a set of values during iteration is
A
counting.
B
searching.
C
sorting.
D
totalling.
[1]
Question text
3
(a) Identify the type of test data in each description.
(i)
Data that falls within the accepted parameters of a validation check and is accepted.
… [1]
(ii)
Data that is the highest or lowest value to be accepted.
… [1]
(b) Explain the purpose of a check digit 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 and a verification check
on a new password to meet the following criteria:
1
Input a new password.
2
If the password is less than 10 characters in length, ask for it to be input again until it is
at least 10 characters in length.
3
If the password is at least 10 characters in length, ask for it to be input a second time.
4
If both inputs of the new password match, output a password accepted message.
5
If both inputs of the new password do not match, go back to step 1 and ask for the new
password to be input for the first time.
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.
…
…
…
…
…
…
…
…
…
…
…
…
Question text
5
This flowchart represents an algorithm.
START
PassCount
0
FailCount
0
Count
0
INPUT Size
No
Yes
IS Size <
50.0 ?
PassCount
PassCount + 1
FailCount
FailCount + 1
Count
Count +
1
No
IS Count = 9
?
Yes
OUTPUT "Number
passed: ", PassCount
OUTPUT "Number
failed: ", FailCount
STOP
© Cambridge University Press & Assessment 2026
,
,
(a) Complete the trace table for the algorithm, using the input data:
49.8, 48.7, 62.5, 49.9, 30.0, 58.2, –12.5, 50.0, 26.7, – 49.2, 58.9
PassCount
FailCount
Count
Size
OUTPUT
[5]
(b) Describe how you would change the flowchart to prevent negative numbers from being input.
…
…
…
… [2]
© Cambridge University Press & Assessment 2026
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]
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
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]
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
Question text
2
Identify three different types of test data that can be used to test a program.
1 …
2 …
3 …
[3]
Question text
5
A hotel booking system is an example of a computer system that is made up of sub-systems.
The booking system:
•
allows the user to select the room type and the number of nights required
•
displays the types of rooms available to the user as pictures or as a list.
Complete the structure diagram for the given parts of the hotel booking system.
Hotel booking system
[4]
Ĭ×Ċ®Ġ´íÈõÏĪÅĊßü¸Ā×
Question text
7
The flowchart represents an algorithm.
START
Count
0
INPUT Number
Value
Count * Number
IS Value <=
Count
Count + 1
Yes
100 ?
No
Count
Count - 1
OUTPUT Count
STOP
ĬÙĊ®Ġ´íÈõÏĪÅĊàüµĀ×
,
,
(a) Complete the tables, using the flowchart, for the given data:
Input data: 20
Count
Number
Value
Output
Input data: 110
Count
Number
Value
Output
[4]
ĬÛĊ®Ġ´íÈõÏĪÅĊàúµĀ×
,
,
(b) State the purpose of the algorithm on page 8. A copy of the algorithm is provided for you on
page 11.
…
… [1]
(c) State a suitable data type for the variable Count
… [1]
(d) Write the algorithm in pseudocode. A copy of the algorithm is provided for you on page 11.
…
…
…
…
…
…
…
…
… [4]
ĬÙĊ®Ġ´íÈõÏĪÅĊÝü·þ×
,
,
START
Count
0
INPUT Number
Value
Count * Number
IS Value <=
Count
Count + 1
Yes
100 ?
No
Count
Count - 1
OUTPUT Count
STOP
ĬÛĊ®Ġ´íÈõÏĪÅĊÝú·þ×