Algorithms and flowcharts – A Level Information Technology (9626)
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
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
Mark has a small glasshouse. He lives in a warm country where plants can die if they are left
without water for too long. The glasshouse has a microprocessor controlled sprinkler system and
a moisture sensor in the soil.
Complete this flowchart to show the processing required to control the level of moisture in the soil
of the glasshouse. You may assume that a pre-set value, dry, has already been input so that the
system can test if the amount of moisture in the soil has reached or fallen below a certain level.
The user activates the microprocessor system by pressing a switch.
(a) Complete the flowchart which inputs the moisture reading in the glasshouse and switches the
sprinkler on and off according to this value. It also checks if the sprinkler is already on or off
before attempting to switch it on or off.
Start
Is the
system
activated?
Stop
is mlevel >
dry?
is sprinkler
on?
[6]
(b) Flowcharts often contain subroutines.
(i)
Draw the symbol used to represent a subroutine in a flowchart.
[1]
(ii)
State what you would expect to see in the first box of a subroutine.
…
… [1]
Question text
4
Computerised weather stations are used to monitor a number of analogue atmospheric variables.
Describe how three of these variables are collected and what needs to happen to the data before
it can be used by a computer.
…
…
…
…
…
…
…
…
…
… [4]
Question text
7
The average (mean) of a set of numbers can be found by adding the numbers together and
dividing the resulting total by how many numbers there are in the set.
Write an algorithm in pseudocode to enter and find the average of a set of numbers using a
REPEAT…UNTIL loop. Your algorithm must work for different sets of numbers.
…
…
…
…
…
…
…
…
…
…
…
…
…
… [8]