Algorithms and flowcharts – A Level Information Technology (9626)

9 questions · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
9626/12/O/N/25 · Question 5Oct/Nov 2025Paper 128 marks
Loading question…
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]
Ĭ×ú¾Ġ´íÈõÏĪÅĊÞû·Ā×

2
9626/12/O/N/24 · Question 4Oct/Nov 2024Paper 127 marks
Loading question…
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]
Ĭ×ú¾Ġ´íÈõÏĪÅĊßû¸Ā×

3
9626/13/O/N/24 · Question 1Oct/Nov 2024Paper 138 marks
Loading question…
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]

Advertisement
4
9626/11/O/N/23 · Question 7Oct/Nov 2023Paper 118 marks
Loading question…
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]

5
9626/12/O/N/23 · Question 9Oct/Nov 2023Paper 128 marks
Loading question…
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]

6
9626/13/O/N/23 · Question 8Oct/Nov 2023Paper 136 marks
Loading question…
Question text

8
The average (mean) of a set of 10 numbers is calculated by:
•
adding the numbers together to get a total
•
dividing the total by 10.
Juan has attempted to draw a flowchart of an algorithm which finds the average of 10 numbers.
He has made some mistakes and omitted to include some boxes.
Start
count ← 0
Input number
total ← total + number
yes
is count = 10?
no
average ← total / number
Suggest six improvements he should make to his flowchart.
1 …
…
2 …
…
3 …
…
4 …
…
5 …
…
6 …
… [6]

7
9626/13/O/N/23 · Question 9Oct/Nov 2023Paper 138 marks
Loading question…
Question text

9
A programmer is writing an algorithm in pseudocode to determine whether a number is a factor of
another number.
Y is a factor of X if the result of X/Y is a whole number.
In pseudocode INT(W) returns the whole number part of W.
If W is the same as INT(W) that means W is a whole number.
Complete the algorithm, including the missing first line, in pseudocode. Each THEN or ELSE
statement should be on a separate line to the action resulting from it. The algorithm uses:
•
W to store the result of X divided by Y
•
Z to store the value of INT(W).
The algorithm must output the values of Y and X together with an appropriate message if Y is a
factor of X or if Y is not a factor of X.
…
W←X/Y
Z=INT(W)
…
…
…
…
…
… [8]

8
9626/12/O/N/22 · Question 9Oct/Nov 2022Paper 1210 marks
Loading question…
Question text

9
A programmer is writing an algorithm in pseudocode to represent a company’s payroll system.
The system calculates a worker’s wages before tax by multiplying the number of hours worked by
the rate of pay per hour. A procedure within the main algorithm representing this could be:
PROCEDURE BeforeTax(Hours, Rate)
Hours * Rate
WagesBeforeTax
ENDPROCEDURE
There are two stages involved in calculating the wages after tax:
•
the amount of tax paid by the worker is calculated by multiplying the WagesBeforeTax by the
rate of tax (35%);
•
the amount of tax paid is then subtracted from the WagesBeforeTax.
(a) Write a procedure for calculating the wages after tax, assuming the value of WagesBeforeTax
is passed to it.
…
…
…
…
…
…
…
… [4]
(b) The programmer’s algorithm will use the BeforeTax() procedure and the procedure created
in part (a) to calculate and output the wage after tax for each worker.
Complete the algorithm. The statements have been numbered to help you.
0
1
count
2
INPUT NumberOfWorkers
3
REPEAT
…
4
…
5
…
6
…
7
…
8
UNTIL … [6]
9

Advertisement
9
9626/13/O/N/22 · Question 8Oct/Nov 2022Paper 136 marks
Loading question…
Question text

8
A teacher wishes to produce a computer program to output the grades awarded for all of her
students.
If a student scores:
•
more than 60 marks, they are awarded a grade A
•
50 – 60 marks, they are awarded a grade B
•
40 – 49 marks, they are awarded a grade C
•
below 40 marks, they are awarded a grade D.
The teacher has written the following algorithm before writing the program. Unfortunately, there
are errors and some lines have been left out (omitted). She has, however, managed to include the
correct number of ELSE statements.
1.
INPUT mark
2.
IF mark > 60
3.
THEN
4.
PRINT "A"
5.
ELSE
6.
IF mark < 50
7.
THEN
8.
PRINT B
9.
ELSE
10.
IF mark >= 40
11.
THEN
12.
PRINT "C"
13.
ELSE
14.
PRINT "D"
15.
ENDIF
16.
ENDIF
Identify each error or omission and how these could be corrected. Line numbers have been
included to help you.
…
…
…
…
…
…
…
…
…
…
…
…
… [6]

Advertisement