Algorithms and flowcharts – A Level Information Technology (9626)
Question text
8
A combined heating and air conditioning system has been installed in a house. The system
measures the temperature in the house and reacts as programmed. The user can override the
temperature settings of the system to suit their needs.
(a) Identify two input devices that will be used as part of this system.
input device 1 …
input device 2 …
[2]
(b) Explain, with the example of a pump, the purpose of an actuator in this system.
…
…
…
…
…
… [2]
© Cambridge University Press & Assessment 2026
,
,
The system has the following rules:
•
If the temperature exceeds 28 degrees Celsius, a fan will turn on and the heating system will
turn off.
•
If the temperature falls below 19 degrees Celsius, the fan will turn off and the heating will
turn on.
(c) Complete the pseudocode algorithm to show the processing that takes place in this
combined system. The variable temperature represents the temperature of the house.
REPEAT
INPUT temperature
[8]
© Cambridge University Press & Assessment 2026
Question text
2
A partially completed algorithm is shown. Line numbers are given for reference. Some lines
are incomplete.
The user will input five numbers, one number at a time.
After five numbers have been entered, the largest number and the smallest number will be
displayed as part of a suitable message.
The algorithm uses a WHILE loop.
0
10
Count
0
20
Number
0
30
Largest_Number
…
40
Smallest_Number
50
INPUT Number
Number
60
Largest_Number
Number
70
Smallest_Number
80
WHILE Count < …
90
INPUT …
100
IF Number … Largest_Number
110
…
Number
120
Largest_Number
130
…
140
IF Number … Smallest_Number
Number
150
THEN Smallest_Number
160
ENDIF
170
…
…
180
Count
190
ENDWHILE
200
PRINT “The largest number is “Largest_Number”
and the smallest number is “Smallest_Number”.”
© Cambridge University Press & Assessment 2026
,
,
(a) Use the table to show how each line may be completed. Line 40 has been done for you as
an example of how the question should be answered.
line
current code
completed code
…
Smallest_Number
0
40
Smallest_Number
80
WHILE Count < …
90
INPUT …
100
IF Number … Largest_Number
110
…
130
…
140
IF Number … Smallest_Number
170
…
…
180
Count
[8]
(b) Explain why Largest_Number (line 60) and Smallest_Number (line 70) are both set to
the same value collected in line 50.
…
…
…
…
…
…
…
…
…
… [4]
© Cambridge University Press & Assessment 2026
Question text
7
A student has created an algorithm to calculate the average of a set of numbers.
•
The user will be asked how many numbers they wish to enter
•
The user will respond with a number
•
The user will then enter that many numbers
•
The algorithm will total the numbers entered and divide the total by how many numbers the
user said they will enter.
The algorithm is shown. The line numbers have been included to help you.
10
10 total
20
PRINT "Input number of repeats"
30
INPUT n
1
40
count
50
REPEAT
+ 1
60
count
70
PRINT "Input number ",count
80
INPUT number
total
90
total + number
100
UNTIL count = number
total / n
110
average
120
PRINT average
The student has made some mistakes in the algorithm.
(a) State three mistakes in this algorithm and suggest how each can be corrected.
mistake 1 …
…
…
…
mistake 2 …
…
…
…
mistake 3 …
…
…
…
[6]
© Cambridge University Press & Assessment 2026
,
,
This algorithm uses a REPEAT…UNTIL loop. The student wishes to change the algorithm so that
it uses a WHILE…ENDWHILE loop.
(b) Contrast a REPEAT…UNTIL loop with a WHILE…ENDWHILE loop.
…
…
…
…
…
… [2]
Question text
5
Lucia has written an algorithm in pseudocode to determine whether a number (X) is a factor of
another number (Y).
X is a factor of Y if the result of Y/X is a whole number.
•
The algorithm uses a WHILE…ENDWHILE statement to check whether X is greater than
zero and that X is less than Y.
•
If X is greater than zero and X is less than Y, the algorithm will output:
•
the values of X and Y
•
an appropriate message if X is a factor of Y
OR
•
an appropriate message if X is not a factor of Y.
In pseudocode INT(W) returns the whole number part of W.
INPUT X
INPUT Y
WHILE X=0 AND <=Y
W←Y/X
Z=INT(W)
IF W=Z
THEN
PRINT X, “ is a factor of Y”
ELSE
PRINT X, “ is not a factor of ”,Y
ENDWHILE
Lucia has made four mistakes in her algorithm.
ĬÕú¾Ġ´íÈõÏĪÅĊÞù·Ā×
,
,
Identify four mistakes in the code. For each mistake, explain in detail what the code as written
would achieve.
Stating that the code would not work is not sufficient to gain any marks.
Mistake 1 …
…
…
Mistake 2 …
…
…
Mistake 3 …
…
…
Mistake 4 …
…
…
[8]
Ĭ×ú¾Ġ´íÈõÏĪÅĊÞû·Ā×
Question text
9
The program flowchart produces the output of the sum of 10 numbers.
There are errors and omissions in the flowchart.
Start
Count
0
No
Count
Stop
>= 10?
Yes
Input
Number
Count
Count + 1
Sum
Sum + number
Explain two corrections that should be made to the flowchart.
…
…
…
…
…
…
…
…
…
… [4]
ĬÓĊ®Ġ´íÈõÏĪÅĊàú·þ×
Question text
7
A teacher is writing a program to process test marks for a class.
For marks above 70, the program will output “You have achieved a Distinction”.
For marks from 55 to 70, the program will output “You have achieved a Merit”.
For marks from 40 to 54, the program will output “You have achieved a Pass”.
For marks below 40, the program will output “You have not reached the Pass mark”.
Write a pseudocode algorithm using REPEAT...UNTIL which allows the teacher to input 20 test
marks and outputs the correct message for each inputted mark.
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
Question text
9
Describe how a microprocessor-controlled car park barrier system makes use of an induction
loop.
…
…
…
…
…
…
…
…
…
…
…
… [5]
ĬÑĊ®Ġ´íÈõÏĪÅĊßûµĀ×
Question text
13 The average (mean) of a set of 12 numbers is calculated by:
•
adding the numbers together to get a total
•
dividing the total by 12.
A student has attempted to draw a flowchart of an algorithm which finds the average of 12
numbers. They have made some errors.
Start
count = 0
average = sum * 12
Input first number
sum = sum + input
Display average
number
Input next number
No
Yes
is count = 12?
ĬÑĊ®Ġ´íÈõÏĪÅĊàû·Ā×
,
,
Redraw the flowchart, with the errors corrected.
[5]
ĬÓĊ®Ġ´íÈõÏĪÅĊàù·Ā×
,
,
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
ĬÍĊ®Ġ´íÈõÏĪÅĊÝú¶Ą×
Question text
12 Employees log in to their company’s database with a User ID and password.
A login screen is displayed. A user enters their User ID.
If employees have forgotten their password, they click on a ‘Forgot Password?’ button.
Draw a program flowchart to represent the following process.
•
If the ‘Forgot Password?’ button is clicked, a message box appears and asks them to enter
their User ID.
•
A check will be performed to see if the system recognises the User ID.
•
If the User ID is not recognised, an error message is displayed and the user will be returned
to the start of the process.
•
If the User ID is recognised, a security question is asked.
•
The user’s response to the security question will be checked. If the user’s response is correct,
then an email containing the password reminder will be sent to the user’s email address.
•
If an incorrect response is given, an error message will be displayed and the user will be
returned to the start of the process.
Draw your program flowchart on the opposite page.
[8]
ĬÙú¾Ġ´íÈõÏĪÅĊàú¸þ×
,
,
Draw your program flowchart below.
ĬÛú¾Ġ´íÈõÏĪÅĊàü¸þ×
,
,
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
ĬÙú¾Ġ´íÈõÏĪÅĊÞú¸Ā×
Question text
4
Draw a program flowchart to represent this algorithm:
•
Input an integer value.
•
Repeat this until you have entered 20 values.
•
At the end, output the largest value and the average of the values.
[7]
Ĭ×ú¾Ġ´íÈõÏĪÅĊßû¸Ā×
Question text
1
Different symbols are used in program flowcharts.
Draw, in the spaces provided, four different program flowchart symbols and for each one, state its
purpose.
Symbol 1
Purpose …
…
…
Symbol 2
Purpose …
…
…
Symbol 3
Purpose …
…
…
ĬÕú¾Ġ´íÈõÏĪÅĊÞü¸þ×
,
,
Symbol 4
Purpose …
…
…
[8]
Question text
8
Create a pseudocode algorithm to allow a number to be entered and to output a result when the
number is:
•
divided by 4 if it is less than 8
•
divided by 8 if it is between 8 and 12 inclusive
•
divided by 12 if it is any other number.
Write the pseudocode algorithm using CASE...ENDCASE.
…
…
…
…
…
…
…
…
…
…
…
…
…
… [6]
Question text
7
Draw a program flowchart, in the space provided, that will allow an examination mark to be entered
and then output an appropriate message giving the correct grade, as shown in the table. All marks
are integers.
Mark
Message
85 or more
Grade A
70 or more
Grade B
50 or more
Grade C
Any other mark
Grade U
[8]
Question text
7
A company employs workers as:
•
labourers who are paid $18 per hour
•
office workers who are paid $22 per hour
•
managers who are paid $30 per hour.
A computer programmer has written part of an algorithm in pseudocode.
The completed algorithm will calculate and output the wage for each worker.
The inputs will be:
•
the number of workers
•
the job code for each worker (L for labourer, O for office worker or M for manager)
•
the number of hours each worker has worked.
If L, O or M is not entered for the job code then the message ‘Invalid job code’ will be output.
The algorithm will terminate when all the workers’ details have been entered. It will use the
CASE…ENDCASE construct to determine the rate of pay.
Complete the algorithm by filling in the missing lines.
…
INPUT number
REPEAT
INPUT jobcode, hours
…
'L' : rate
18
…
…
…
…
…
…
count
count + 1
…
[8]
Question text
9
Sukhjinder, a mathematics student, has defined a procedure using pseudocode. It calculates the
area of a parallelogram by multiplying the base by the height. All parallelograms will have an area
of less than 1000.
The procedure Sukhjinder has written is:
PROCEDURE parallelogram(base,height)
base*height
area
ENDPROCEDURE
He has also begun writing an algorithm which calls the procedure and then passes back the area.
The main algorithm accepts inputs of the base and the height of 10 parallelograms, one at a time.
It will output the areas of the largest and smallest parallelograms.
Complete the algorithm for Sukhjinder by filling in the missing lines.
0
count
1000
smallest
…
WHILE count < 10
INPUT base, height
…
IF area < smallest
THEN
…
…
…
…
…
…
ENDIF
…
…
… [8]