0% found this document useful (0 votes)
13 views99 pages

2210 CS OL P2 Topicals 2023-24 A4

Uploaded by

emaandoulat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views99 pages

2210 CS OL P2 Topicals 2023-24 A4

Uploaded by

emaandoulat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 99

TABLE OF CONTENT

S.NO. TOPIC NAME PAGE NO.

1 ALGORITHM DESIGN & PROBLEM SOLVING 1

2 PROGRAMMING 35

3 DATABASE 75

4 BOOLEAN LOGIC 87
PAGE 1

ALGORITHM
DESIGN
AND
PROBLEM
SOLVING
PAGE 2
PAGE 3

1 (a) Four descriptions of stages in the program development life cycle are shown.

Draw one line to link each description to its most appropriate program development life cycle
stage.

Not all program development life cycle stages will be used.

Program development life cycle description Program development life cycle stage

develop an algorithm to solve the problem analysis


by using structure diagrams, flowcharts or
pseudocode

coding

detect and fix the errors in the program


design

identify the problem and its requirements


evaluation

write and implement the instructions to


solve the problem testing
[4]
(b) Identify three of the component parts after a problem has been decomposed.

1 ................................................................................................................................................

...................................................................................................................................................

2 ................................................................................................................................................

...................................................................................................................................................

3 ................................................................................................................................................

...................................................................................................................................................
[3]

2 Tick (9) one box to show the name of the data structure used to store a collection of data of the
same data type.

A Array

B Constant

C Function

D Variable
[1]
© UCLES 2023 2210/21/M/J/23
PAGE 4

3 (a) Describe what is meant by data validation.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(b) A validation check is used to make sure that any value that is input is an integer between 30
and 200 inclusive.

Give one example of each type of test data to check that the validation check is working as
intended. Each example of test data must be different.

Give a reason for each of your choices of test data.

Normal test data .......................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

Abnormal test data ...................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

Extreme test data .....................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................
[6]

4 Explain the purpose of the library routines DIV and ROUND

DIV ...................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

ROUND ..............................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[4]
© UCLES 2023 2210/21/M/J/23 [Turn over
PAGE 5

5 An algorithm has been written in pseudocode to allow some numbers to be input. All the positive
numbers that are input are totalled and this total is output at the end.
An input of 0 stops the algorithm.

01 Exit 1ĸ
02 WHILE Exit <> 0 DO
03 INPUT Number
04 IF Number < 0
05 THEN
06 Total ĸ
Total + Number
07 ELSE
08 IF Number = 0
09 THEN
10 Exit 1 ĸ
11 ENDIF
12 ENDIF
13 ENDIF
14 OUTPUT "The total value of your numbers is ", Number

(a) Identify the four errors in the pseudocode and suggest a correction for each error.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2023 2210/21/M/J/23


PAGE 6

7 The flowchart represents an algorithm.

START

Pointer 1

INPUT
Letter

IS No
Word[Pointer, 1] Pointer Pointer + 1
= Letter ?

Yes

OUTPUT "Letter ", Letter,


" is represented by ",
Word[Pointer, 2]

OUTPUT "Another Letter?


(Y or N)"

INPUT Choice

Yes IS No
Choice = STOP
'Y' ?

© UCLES 2023 2210/21/M/J/23


PAGE 7

The table represents the two-dimensional (2D) array Word[] which stores the first half of the
phonetic alphabet used for radio transmission. For example, Word[10,1] is ‘J’.

Index 1 2
1 A Alpha
2 B Bravo
3 C Charlie
4 D Delta
5 E Echo
6 F Foxtrot
7 G Golf
8 H Hotel
9 I India
10 J Juliet
11 K Kilo
12 L Lima
13 M Mike

(a) Complete the trace table for the algorithm by using the input data: F, Y, D, N

Pointer Letter Choice OUTPUT

[4]

© UCLES 2023 2210/21/M/J/23 [Turn over


PAGE 8

(b) Identify the type of algorithm used.

...................................................................................................................................................

............................................................................................................................................. [1]

(c) Describe one problem that could occur with this algorithm if an invalid character was input.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2023 2210/21/M/J/23


PAGE 9

1 Tick () one box to identify the first stage of the program development life cycle.

A Analysis

B Coding

C Design

D Testing
[1]

2 Four logic gates and five standard symbols for logic gates are shown.

Draw one line to link each logic gate to its standard symbol. Not all standard symbols will be used.

Logic gate Standard symbol

AND

OR

NAND

NOT

[4]

3 Identify three different ways that the design of a solution to a problem can be presented.

1 .......................................................................................................................................................

..........................................................................................................................................................

2 .......................................................................................................................................................

..........................................................................................................................................................

3 .......................................................................................................................................................

..........................................................................................................................................................
[3]

© UCLES 2023 2210/22/M/J/23


PAGE 10

4 A program needs to make sure the value input for a measurement meets the following rules:
• the value is a positive number
• a value is always input
• the value is less than 1000.

(a) Describe the validation checks that the programmer would need to use.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(b) The program needs editing to include a double entry check for the value input.

(i) State why this check needs to be included.

...........................................................................................................................................

..................................................................................................................................... [1]

(ii) The input value needs to be stored in the variable Measurement


Write pseudocode to perform the double entry check until a successful input is made.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

© UCLES 2023 2210/22/M/J/23 [Turn over


PAGE 11

9 This flowchart represents an algorithm.

START

F 0
C 1

IS X[C] < No
T X[C]
X[C + 1]?

Yes
X[C] X[C + 1]

X[C + 1] T

F 1

C C + 1

No
IS C = 5?

Yes

No
IS F = 0?

Yes

STOP

© UCLES 2023 2210/22/M/J/23


PAGE 12

(a) The array X[1:5] used in the flowchart contains this data:

X[1] X[2] X[3] X[4] X[5]

10 1 5 7 11

Complete the trace table by using the data given in the array.

F C X[1] X[2] X[3] X[4] X[5] T

10 1 5 7 11

[5]

(b) Describe what the algorithm represented by the flowchart is doing.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2023 2210/22/M/J/23 [Turn over


PAGE 13

1 Tick () one box to complete the sentence.

Verification is used to make sure that a value entered

A has not changed during input.

B is an integer.

C is correct.

D is not a string.
[1]

2 A type of validation check is a length check. Another type of validation check is used to make sure
that any date entered is in the dd/mm/yyyy style:
dd means day, mm means month and yyyy means year.

(a) State the type of validation check used.

............................................................................................................................................. [1]

(b) Give one example of normal test data and one example of abnormal test data you should
use to make sure the check in part (a) is working properly.

State a reason for each of your choices of test data.

Normal ......................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

Abnormal ..................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................
[4]

(c) Describe how a length check could be used with the date entered.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2023 2210/22/O/N/23


PAGE 14

4 An algorithm has been written in pseudocode to allow the names of 50 cities and their countries to
be entered and stored in a two-dimensional (2D) array. The contents of the array are then output.

01 DECLARE City ARRAY[1:50, 1:2] OF BOOLEAN


02 DECLARE Count : INTEGER
03 DECLARE Out : INTEGER
04 Count 1
05 IF
06 OUTPUT "Enter the name of the city"
07 INPUT City[Count, 2]
08 OUTPUT "Enter the name of the country"
09 INPUT City[Count, 2]
10 Count Count + 1
11 UNTIL Count = 50
12 FOR Out 1 TO 1
13 OUTPUT "The city ", City[Out, 1], " is in ", City[Out, 2]
14 NEXT Out

(a) Identify the four errors in the pseudocode and suggest corrections.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2023 2210/22/O/N/23


PAGE 15

(b) Describe the changes you should make to the corrected algorithm to allow the name of a
country to be input and to display only the stored cities from that country.

You do not need to rewrite the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [5]

5 Explain how variables and constants should be used when creating and running a program.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................... [3]

© UCLES 2023 2210/22/O/N/23 [Turn over


PAGE 16

6 The flowchart represents an algorithm that performs a process on groups of values that are input.
The algorithm will fail if the first value of any group is 0.

An input of –1 will terminate the algorithm.

START

Total 0
OUTPUT
"Average is ",
Average
Count 0

INPUT OUTPUT
Value "Total is ",
Total

IS Yes
Value = Average Total / Count
0 ?

No

IS Yes
Value = STOP
–1 ?

No

Total Total + Value

Count Count + 1

© UCLES 2023 2210/22/O/N/23


PAGE 17

(a) Complete the trace table for the input data:

25, 35, 3, 0, 57, 20, 25, 18, 0, –1, 307, 40, 0

Value Average Total Count OUTPUT

[5]

(b) Describe the purpose of the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2023 2210/22/O/N/23 [Turn over


PAGE 18

1 Tick () one box to show which term is an example of a verification check.

A Double entry check

B Format check

C Length check

D Presence check
[1]

2 Tick () one box to show which library routine returns the remainder of a division.

A DIV

B MOD

C RANDOM

D ROUND
[1]

© UCLES 2023 2210/23/O/N/23


PAGE 19

4 A programmer is writing a data entry program for booking theatre seats.


The programmer needs the program to accept only whole numbers that are greater than or equal
to one and less than or equal to six.

(a) Give the names of two validation checks that are required for this program.

1 ................................................................................................................................................

2 ................................................................................................................................................
[2]

(b) Complete this pseudocode to perform your two validation checks, using your answers given
in (a):

OUTPUT "Please enter the number of seats you want to book "

INPUT Seats

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[5]

(c) Give one item of test data to use when testing this program.
State the reason for your choice of test data.

Test data ...................................................................................................................................

Reason for choice .....................................................................................................................

...................................................................................................................................................
[2]

© UCLES 2023 2210/23/O/N/23


PAGE 20

5 An algorithm has been written in pseudocode to check if a new password is in a list of previously
used passwords OldList[]
If the password is not found, the new password will be stored at the end of the list to replace
"XXXX" already stored there.

01 OUTPUT "Enter your new password "


02 INPUT NewPassword
03 Posn 1
04 Found FALSE
05 REPEAT
06 IF Password = OldList[Posn]
07 THEN
08 Found TRUE
09 ELSE Posn Posn + 1
10 ENDIF
11 UNTIL Found AND OldList[Posn] = "XXXX"
12 IF Found
13 THEN
14 OUTPUT "Password has been used before"
15 ELSE
16 INPUT "New password accepted"
17 OldList[Posn] NewPassword
18 ENDIF

(a) Identify the three errors in the pseudocode and suggest corrections.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2023 2210/23/O/N/23


PAGE 21

(b) Complete this flowchart for the corrected algorithm:

START

STOP

[6]

© UCLES 2023 2210/23/O/N/23 [Turn over


PAGE 22

10

8 This is an algorithm to find if a batch of parts has been manufactured successfully.

START

Accept 0
Reject 0

INPUT PartOK

No
IS PartOK Reject Reject + 1
= 'Y'?
Yes

Accept Accept + 1

No IS Accept
= 10 ?

Yes

Yes
IS Reject Error Reject/Accept * 100
> 1?

No
OUTPUT
"Too many rejected ",
OUTPUT Error, "% error"
"Success"

STOP

© UCLES 2023 2210/23/O/N/23


PAGE 23

11

(a) Complete the trace table using this data:


Y, Y, Y, N, Y, Y, Y, Y, N, Y, Y, Y, Y

Accept Reject PartOK Error OUTPUT

[5]

(b) Describe how the algorithm should be changed to accept ‘Y’ or ‘y’ for a successfully
manufactured part.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2023 2210/23/O/N/23 [Turn over


PAGE 24

1 Tick (9) one box to complete this sentence.

A validation check to make sure that an email address contains an ‘@’ sign is a

A range check.

B visual check.

C presence check.

D format check.
[1]

2 Four descriptions of programming concepts and five programming concepts are shown.

(a) Draw one line to link each description to the most appropriate programming concept.

Not all programming concepts will be used.

Description Programming concept

function
a subroutine that may not return a value

procedure
a value that is declared and used within a
specific procedure
parameter
a value that a procedure expects you to
supply when it is called
global variable

a subroutine that will always return a value


local variable

[4]

(b) Write the pseudocode to use a procedure named Average that passes the values 25 and 50
to the procedure.

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2024 2210/21/M/J/24


PAGE 25

4 This pseudocode algorithm is intended to allow, at random, between 1 and 20 values to be entered
and totalled. The total and average of the entered values are output at the end of the algorithm.

01 DECLARE Loop : STRING


02 DECLARE Limit : INTEGER
03 DECLARE Value : REAL
04 DECLARE Total : REAL
05 Total 0
06 Limit ROUND(RANDOM() * 19,0) + 1
07 IF Loop 1 TO Limit
08 OUTPUT "Enter a number"
09 INPUT Loop
10 Total Total * Value
11 NEXT Loop
12 OUTPUT "The total of the numbers entered is ", Total
13 OUTPUT "The average of the numbers entered is ", Total / Limit

(a) Identify the line numbers of four errors in the pseudocode and suggest corrections.

Error 1 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]

(b) Write the pseudocode statement that would output the average calculated in line 13 of the
algorithm rounded to one decimal place.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2024 2210/21/M/J/24


PAGE 26

(c) Explain how you should alter the original corrected algorithm to make sure that all the
numbers entered are between 1 and 500 inclusive. If any numbers fall outside these limits, a
replacement value is requested and entered.

You do not need to re-write the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

5 Write the pseudocode statements to perform this task:


• accept the input of a whole number from 1 to 4 inclusive
• use a CASE statement to:
ż RXWSXWWKHQXPEHU WRLQFOXVLYH WKDWZDVHQWHUHG
ż RXWSXWWKHZRUG³(5525´LIDWRLQFOXVLYHQXPEHUZDVnot entered.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................... [5]

© UCLES 2024 2210/21/M/J/24 [Turn over


PAGE 27

6 The flowchart represents an algorithm.

START

Result Limit DIV 2 + 1


INPUT
Limit
OUTPUT
Numbers[Result]
Count 1

INPUT
Numbers[Count]
STOP

Count Count + 1

No IS Count >
Limit?

IS Numbers[Count] > No
Yes
Numbers[Count + 1]?
Flag TRUE

Yes

Swap Numbers[Count]
IS Flag = No
TRUE?

Numbers[Count] Numbers[Count + 1]
Yes

Flag False Numbers[Count + 1] Swap


Count 1

Flag True

Yes IS Count > No


Limit – 1?

Count Count + 1

© UCLES 2024 2210/21/M/J/24


PAGE 28

(a) Complete the trace table for the input data:

7, 47, 50, 52, 60, 80, 63, 70

Numbers

Limit Count [1] [2] [3] [4] [5] [6] [7] Flag Swap Result OUTPUT

[7]
© UCLES 2024 2210/21/M/J/24 [Turn over
PAGE 29

1 Tick () one box to identify a method used to design and construct a solution to a computing
problem.

A analysis

B coding

C flowchart

D testing
[1]

2 Four logic functions and five standard symbols for logic gates are shown.

Draw one line to link each logic function to its standard symbol. Not all standard symbols will be
used.

Logic function Standard symbol

AND

XOR

NAND

OR

[4]

3 Identify three different tasks in the analysis stage of the program development life cycle.

1 .......................................................................................................................................................

..........................................................................................................................................................

2 .......................................................................................................................................................

..........................................................................................................................................................

3 .......................................................................................................................................................

..........................................................................................................................................................
[3]

© UCLES 2024 2210/22/M/J/24


PAGE 30

4 A program needs to make sure the characters input for a product code meet these rules:

• The product code is six characters in length.


• The first two characters must be “PD”.
• The last four characters must be a number in the range 1000 to 9999 inclusive.

(a) Identify three validation checks and state how each check would make sure the product code
met one of these rules.

Check 1 ....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Check 2 ....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Check 3 ....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[6]

(b) The program design will include a pseudocode algorithm. Assume that the product code is
stored in the variable Product

(i) Write the pseudocode to make sure that the product code is six characters in length.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [2]

(ii) Write the pseudocode to make sure that the first two characters of the product code are
“PD”.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [2]

© UCLES 2024 2210/22/M/J/24 [Turn over


PAGE 31

7 An algorithm has been written in pseudocode to find and display the maximum and minimum
values in an array of 1000 positive numbers. The array List[] starts at index 1

01 Max List[1]
02 Min List[1]
03 FOR Counter 2 TO 1000
04 IF List[Counter] < Max
05 THEN
06 Max List[Counter]
07 ENDIF
 ,)/LVW>&RXQW@‫ޗ‬0LQ
09 THEN
10 Min List[Counter]
11 ENDWHILE
12 NEXT Counter
13 OUTPUT "Maximum value is ", Max
14 OUTPUT "Minimum value is ", Min

(a) Give a line number for each of these types of statement:

Assignment statement ..............................................................................................................

Selection statement ..................................................................................................................

Iteration statement ....................................................................................................................


[3]

(b) Identify the line numbers of the three errors in the pseudocode and suggest a correction for
each error.

Error 1 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2024 2210/22/M/J/24


PAGE 32

9 This flowchart represents an algorithm.

START

A FALSE
B 1

IS List[B] > No
T List[B]
List[B + 1]?

Yes
List[B] List[B + 1]

List[B + 1] T

A TRUE

B B+1

No IS B =
5?

Yes

Yes IS A =
TRUE?

No

STOP

(a) The array List[1:5] used in the flowchart contains this data:

List[1] List[2] List[3] List[4] List[5]

15 17 20 5 9

© UCLES 2024 2210/22/M/J/24


PAGE 33

Complete the trace table using the data given in the array.

A B List[1] List[2] List[3] List[4] List[5] T


15 17 20 5 9

[5]

(b) Describe what the algorithm represented by the flowchart is doing.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]
© UCLES 2024 2210/22/M/J/24 [Turn over
PAGE 34
PAGE 35

PROGRAMMING

PAGE 36
PAGE 37

1 (a) Four descriptions of stages in the program development life cycle are shown.

Draw one line to link each description to its most appropriate program development life cycle
stage.

Not all program development life cycle stages will be used.

Program development life cycle description Program development life cycle stage

develop an algorithm to solve the problem analysis


by using structure diagrams, flowcharts or
pseudocode

coding

detect and fix the errors in the program


design

identify the problem and its requirements


evaluation

write and implement the instructions to


solve the problem testing
[4]
(b) Identify three of the component parts after a problem has been decomposed.

1 ................................................................................................................................................

...................................................................................................................................................

2 ................................................................................................................................................

...................................................................................................................................................

3 ................................................................................................................................................

...................................................................................................................................................
[3]

2 Tick (9) one box to show the name of the data structure used to store a collection of data of the
same data type.

A Array

B Constant

C Function

D Variable
[1]
© UCLES 2023 2210/21/M/J/23
PAGE 38

3 (a) Describe what is meant by data validation.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(b) A validation check is used to make sure that any value that is input is an integer between 30
and 200 inclusive.

Give one example of each type of test data to check that the validation check is working as
intended. Each example of test data must be different.

Give a reason for each of your choices of test data.

Normal test data .......................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

Abnormal test data ...................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

Extreme test data .....................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................
[6]

4 Explain the purpose of the library routines DIV and ROUND

DIV ...................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

ROUND ..............................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[4]
© UCLES 2023 2210/21/M/J/23 [Turn over
PAGE 39

5 An algorithm has been written in pseudocode to allow some numbers to be input. All the positive
numbers that are input are totalled and this total is output at the end.
An input of 0 stops the algorithm.

01 Exit 1ĸ
02 WHILE Exit <> 0 DO
03 INPUT Number
04 IF Number < 0
05 THEN
06 Total ĸ
Total + Number
07 ELSE
08 IF Number = 0
09 THEN
10 Exit 1 ĸ
11 ENDIF
12 ENDIF
13 ENDIF
14 OUTPUT "The total value of your numbers is ", Number

(a) Identify the four errors in the pseudocode and suggest a correction for each error.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2023 2210/21/M/J/23


PAGE 40

10

8 The function LENGTH(Phrase) calculates the length of a string Phrase

(a) Write the pseudocode statements to:


• store the string "The beginning is the most important part" in Phrase
• calculate and output the length of the string
• output the string in upper case.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(b) Write the output your pseudocode should produce.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2023 2210/21/M/J/23


PAGE 41

14

11 A one-dimensional (1D) array Days[] contains the names of the days of the week. A
two-dimensional (2D) array Readings[] is used to store 24 temperature readings, taken once
an hour, for each of the seven days of the week. A 1D array AverageTemp[] is used to store the
average temperature for each day of the week.

The position of any day’s data is the same in all three arrays. For example, if Wednesday is
in index 4 of Days[], Wednesday’s temperature readings are in index 4 of Readings[] and
Wednesday’s average temperature is in index 4 of AverageTemp[]

The temperature readings are in Celsius to one decimal place. Temperatures can only be from
–20.0 °C to +50.0 °C inclusive.

Write a program that meets the following requirements:


• input and validate the hourly temperatures for one week
• calculate and store the average temperature for each day of the week
• calculate the average temperature for the whole week
• convert all the average temperatures from Celsius to Fahrenheit by using the formula
Fahrenheit = Celsius * 9 / 5 + 32
• output the average temperature in Celsius and in Fahrenheit for each day
• output the overall average temperature in Celsius and in Fahrenheit for the whole week.

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to declare any arrays, variables or constants; you may assume that this has
already been done.

All inputs and outputs must contain suitable messages.

All data output must be rounded to one decimal place.

You will need to initialise and populate the array Days[] at the start of the program.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 2210/21/M/J/23
PAGE 42

15

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 2210/21/M/J/23 [Turn over
PAGE 43

16

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................. [15]

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
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
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

© UCLES 2023 2210/21/M/J/23


PAGE 44

5 Circle five file-handling operations.

calculate close count create input open

output print read sort search

test total write


[5]

6 State three different features of a high-level programming language that a programmer could use
to make sure that their program will be easier to understand by another programmer.
Give an example for each feature.

Feature 1 ..........................................................................................................................................

..........................................................................................................................................................

Example ...........................................................................................................................................

..........................................................................................................................................................

Feature 2 ..........................................................................................................................................

..........................................................................................................................................................

Example ...........................................................................................................................................

..........................................................................................................................................................

Feature 3 ..........................................................................................................................................

..........................................................................................................................................................

Example ...........................................................................................................................................

..........................................................................................................................................................
[6]

© UCLES 2023 2210/22/M/J/23


PAGE 45

7 An algorithm has been written in pseudocode to calculate a check digit for a four-digit number.
The algorithm then outputs the five-digit number including the check digit.
The algorithm stops when –1 is input as the fourth digit.

01 Flag FALSE
02 REPEAT
03 Total 0
04 FOR Counter 1 TO 4
05 OUTPUT "Enter a digit ", Counter
06 INPUT Number[Counter]
07 Total Total + Number * Counter
08 IF Number[Counter] = 0
09 THEN
10 Flag TRUE
11 ENDIF
12 NEXT Counter
13 IF NOT Flag
14 THEN
15 Number[5] MOD(Total, 10)
16 FOR Counter 0 TO 5
17 OUTPUT Number[Counter]
18 NEXT
19 ENDIF
20 UNTIL Flag

(a) Give the line number(s) for the statements showing:

Totalling ....................................................................................................................................

Count-controlled loop ...............................................................................................................

Post-condition loop ...................................................................................................................


[3]

(b) Identify the three errors in the pseudocode and suggest a correction for each error.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2023 2210/22/M/J/23


PAGE 46

(c) The algorithm does not check that each input is a single digit.
Identify the place in the algorithm where this check should occur.
Write pseudocode for this check.
Your pseudocode must make sure that the input is a single digit and checks for –1

Place in algorithm .....................................................................................................................

Pseudocode ..............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

8 Consider this logic expression.

X = (A OR B) AND (NOT B AND C)

Complete the truth table for this logic expression.

Working space
A B C X

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

[4]

© UCLES 2023 2210/22/M/J/23 [Turn over


PAGE 47

11

11 The variables P and Q are used to store data in a program. P stores a string. Q stores a character.

(a) Write pseudocode statements to declare the variables P and Q, store "The world" in P and
store 'W' in Q

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(b) Write a pseudocode algorithm to:


• convert P to upper case
• find the position of Q in the string P (the first character in this string is in position 1)
• store the position of Q in the variable Position

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

(c) Give the value of Position after the algorithm has been executed with the data in
question 11(a).

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2023 2210/22/M/J/23 [Turn over


PAGE 48

12

12 A two-dimensional (2D) array Account[] contains account holders’ names and passwords for a
banking program.

A 2D array AccDetails[] has three columns containing the following details:


• column one stores the balance – the amount of money in the account, for example 250.00
• column two stores the overdraft limit – the maximum total amount an account holder can
borrow from the bank after the account balance reaches 0.00, for example 100.00
• column three stores the withdrawal limit – the amount of money that can be withdrawn at one
time, for example 200.00

The amount of money in a bank account can be negative (overdrawn) but not by more than the
overdraft limit.
For example, an account with an overdraft limit of 100.00 must have a balance that is greater than
or equal to –100.00

Suitable error messages must be displayed if a withdrawal cannot take place, for example if the
overdraft limit or the size of withdrawal is exceeded.

The bank account ID gives the index of each account holder’s data held in the two arrays.
For example, account ID 20’s details would be held in:
Account[20,1] and Account[20,2]
AccDetails[20,1] AccDetails[20,2] and AccDetails[20,3]

The variable Size contains the number of accounts.

The arrays and variable Size have already been set up and the data stored.

Write a program that meets the following requirements:


• checks the account ID exists and the name and password entered by the account holder
match the name and password stored in Account[] before any action can take place
• displays a menu showing the four actions available for the account holder to choose from:
1. display balance
2. withdraw money
3. deposit money
4. exit
• allows an action to be chosen and completed. Each action is completed by a procedure
with a parameter of the account ID.

You must use pseudocode or program code and add comments to explain how your code works.
All inputs and outputs must contain suitable messages.

You only need to declare any local arrays and local variables that you use.

You do not need to declare and initialise the data in the global arrays Account[] and
AccDetails[] and the variable Size

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 2210/22/M/J/23
PAGE 49

13

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 2210/22/M/J/23 [Turn over
PAGE 50

14

..........................................................................................................................................................

.........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................. [15]
© UCLES 2023 2210/22/M/J/23
PAGE 51

3 Four pseudocode statements and five pseudocode uses are shown.

(a) Draw one line to link each pseudocode statement to the most appropriate pseudocode use.

Not all pseudocode uses will be required.

Pseudocode statement Pseudocode use

CALL Colour(NewColour) counting

finding an average
Value (A1 + A2 + A3) / 3

totalling

Loop1 Loop1 + 1
using a conditional statement

IF Count > 7 THEN X1 0 using a procedure


[4]

(b) A one-dimensional (1D) array called Temperatures[] has 25 elements beginning at


index 1. It holds values that range between –20 and 100 inclusive.

Write a pseudocode algorithm using a single loop to find the lowest value in this array and
output the result only once.

You do not need to declare or populate this array.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]
© UCLES 2023 2210/22/O/N/23 [Turn over
PAGE 52

(b) Describe the changes you should make to the corrected algorithm to allow the name of a
country to be input and to display only the stored cities from that country.

You do not need to rewrite the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [5]

5 Explain how variables and constants should be used when creating and running a program.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................... [3]

© UCLES 2023 2210/22/O/N/23 [Turn over


PAGE 53

7 The string operation SUBSTRING(Quote, Start, Number) returns a string from Quote
beginning at position Start that is Number characters long. The first character in Quote is in
position 1.

Write pseudocode statements to:


• store the string "Learning Never Exhausts The Mind" in Quote
• extract and display the words "The Mind" from the string
• output the original string in lower case.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................... [5]

8 Explain why a programmer would use procedures and parameters when writing a program.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................... [4]

© UCLES 2023 2210/22/O/N/23


PAGE 54

12

11 A wood flooring company stores the names of up to 100 customers in a one-dimensional (1D) array
Customers[]. A two-dimensional (2D) array Quotations[] stores details of each customer’s
quotation:
• length of room (one decimal place)
• width of room (one decimal place)
• area of wood required (rounded up to next whole number)
• choice of wood index (whole number)
• price of wood required in dollars (two decimal places).

The floor measurements (room length and room width) are taken in metres. All floors are rectangles
and room measurements must be between 1.5 and 10.0 inclusive.

The index of any customer’s data is the same in both arrays. For example, a customer named in
index 4 of Customers[] corresponds to the data in index 4 of Quotations[]

The wood choices available are:

Index Wood type Price per square metre ($)


1 Laminate 29.99
2 Pine 39.99
3 Oak 54.99

The data are stored in two 1D arrays named WoodType[] and Price[]. The index of the wood
type and price in their arrays share the same index number.

Write a program that meets the following requirements:


• input a new customer’s name, room length and room width
• check that each measurement is valid
• output an error message and require the measurement to be re-entered until it is valid
• calculate the area of the room by multiplying together the length of the room and the width of
the room
• input the choice of wood and find its price per square metre
• calculate the price of the wood needed
• store all data in the relevant array
• output the customer’s quotation to include: the name of the customer, the choice of wood and
the calculated price of the wood required
• continue to accept the next customer.

You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; you may assume that this has already been
done.

You will need to initialise WoodType[] and Price[]

All inputs and outputs must contain suitable messages.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 2210/22/O/N/23
PAGE 55

13

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 2210/22/O/N/23 [Turn over
PAGE 56

14

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................. [15]

© UCLES 2023 2210/22/O/N/23


PAGE 57

3 (a) Four pseudocode descriptions and five pseudocode keywords are shown.

Draw one line to link each pseudocode description to the most appropriate pseudocode
keyword. Not all pseudocode keywords will be used.

Pseudocode description Pseudocode keyword

stores data in a file OUTPUT

WRITE
retrieves data from a file

READ

displays data on a screen


OPEN

enters data from a keyboard INPUT

[4]

(b) Give two reasons for storing data in a file.

1 ................................................................................................................................................

...................................................................................................................................................

2 ................................................................................................................................................

...................................................................................................................................................
[2]

© UCLES 2023 2210/23/O/N/23 [Turn over


PAGE 58

(d) Consider this logic expression:

X = (NOT A OR NOT B) OR NOT C

Draw a logic circuit for this logic expression. Each logic gate must have a maximum of two
inputs. Do not attempt to simplify this logic expression.

B X

[5]

7 A program uses both local variables and global variables.

Describe two differences between local variables and global variables.

Difference 1 ......................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Difference 2 ......................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[4]

© UCLES 2023 2210/23/O/N/23 [Turn over


PAGE 59

14

10 A weather station takes temperature readings once an hour for a week. These temperatures are
stored in a two-dimensional (2D) array Temperatures[]
Each column contains 24 readings for a single day. The first temperature is recorded at 00:00 and
the final temperature at 23:00. There are seven columns, one for each day of the week, starting
with Monday and ending with Sunday.

The variables MaxDay, MinDay and AvDay are used to store the maximum, minimum, and
average temperatures for a day. The variables MaxWeek, MinWeek and AvWeek are used to store
the maximum, minimum, and average temperatures for the week.

The array has already been set up and the data stored.

Write a program that meets the following requirements:


• finds the maximum and minimum temperatures for each day
• calculates the average temperature for each day
• outputs for each day:
– name of the day, for example Monday
– maximum temperature
– minimum temperature
– average temperature
• finds the maximum and minimum temperatures for the week
• calculates the average temperature for the week
• outputs:
– maximum temperature for the week
– minimum temperature for the week
– average temperature for the week.

All temperatures output must be rounded to two decimal places.

You must use pseudocode or program code and add comments to explain how your code works.
All inputs and outputs must contain suitable messages.

You do not need to declare any arrays or variables; you may assume that this has already been
done.
You do not need to initialise the data in the array Temperatures[]

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 2210/23/O/N/23
PAGE 60

15

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2023 2210/23/O/N/23 [Turn over
PAGE 61

16

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................. [15]

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
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
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

© UCLES 2023 2210/23/O/N/23


PAGE 62

1 Tick (9) one box to complete this sentence.

A validation check to make sure that an email address contains an ‘@’ sign is a

A range check.

B visual check.

C presence check.

D format check.
[1]

2 Four descriptions of programming concepts and five programming concepts are shown.

(a) Draw one line to link each description to the most appropriate programming concept.

Not all programming concepts will be used.

Description Programming concept

function
a subroutine that may not return a value

procedure
a value that is declared and used within a
specific procedure
parameter
a value that a procedure expects you to
supply when it is called
global variable

a subroutine that will always return a value


local variable

[4]

(b) Write the pseudocode to use a procedure named Average that passes the values 25 and 50
to the procedure.

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2024 2210/21/M/J/24


PAGE 63

(c) Outline the role of procedures and functions in creating a program that is easier to maintain.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

3 State what is meant by the data types integer and real.


Give an example of each.

Integer ..............................................................................................................................................

..........................................................................................................................................................

Example ...........................................................................................................................................

Real ..................................................................................................................................................

..........................................................................................................................................................

Example ...........................................................................................................................................
[4]

© UCLES 2024 2210/21/M/J/24 [Turn over


PAGE 64

(c) Explain how you should alter the original corrected algorithm to make sure that all the
numbers entered are between 1 and 500 inclusive. If any numbers fall outside these limits, a
replacement value is requested and entered.

You do not need to re-write the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

5 Write the pseudocode statements to perform this task:


• accept the input of a whole number from 1 to 4 inclusive
• use a CASE statement to:
ż RXWSXWWKHQXPEHU WRLQFOXVLYH WKDWZDVHQWHUHG
ż RXWSXWWKHZRUG³(5525´LIDWRLQFOXVLYHQXPEHUZDVnot entered.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................... [5]

© UCLES 2024 2210/21/M/J/24 [Turn over


PAGE 65

(b) Outline the processes involved in the algorithm shown in the flowchart on page 6.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

7 (a) Outline why it is useful to store data in a file.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(b) The function LENGTH(X) calculates the length of a string X

Write the pseudocode statements to:


• read the contents of the text file Quotation.txt into an appropriate string variable that
has been declared
• output the string in upper case and the length of the string.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2024 2210/21/M/J/24


PAGE 66

12

10 The one-dimensional (1D) array Clubs[] is used to store the names of 12 cricket clubs in a local
sports league.

The two-dimensional (2D) array Statistics[] is used to store, for each cricket club, the number
of:
• matches won
• matches drawn
• matches lost.

The 1D array Points[] is used to store the total number of points each cricket club has been
awarded.

The position of any cricket club’s data is the same in all three arrays. For example, the data in
index 2 of Statistics[] and index 2 of Points[] belongs to the cricket club in index 2 of
Clubs[]

The variable Matches stores the number of matches played by each team. Each team plays the
same number of matches.

Points are awarded for:


• a win – 12 points
• a draw – 5 points
• a loss – 0 points.

Write a program that meets the following requirements:


• allows the number of matches played to be input and stored, with a maximum of 22 matches
• validates the number of matches played
• allows the names of the cricket clubs to be input and stored
• allows the number of matches won, drawn and lost to be input and stored for each team
• validates the number of matches won, drawn or lost against the number of matches played
• asks the user to re-enter the number of matches won, drawn or lost if the total does not match
the number of matches played
• calculates and stores the total number of points for each club
• finds the cricket club or clubs with the highest number of points
• outputs the name or names of the winning club or clubs, the number of wins and the total
number of points awarded.

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to declare any arrays or variables; you may assume that this has already been
done.

All inputs and outputs must contain suitable messages.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

© UCLES 2024 2210/21/M/J/24


PAGE 67

13

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2024 2210/21/M/J/24 [Turn over
PAGE 68

14

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................. [15]
© UCLES 2024 2210/21/M/J/24
PAGE 69

5 A high-level programming language makes use of arithmetic, Boolean and logical operators.

State how each type of operator is used.


Give an example statement, in pseudocode, for each one.

Arithmetic .........................................................................................................................................

..........................................................................................................................................................

Example ...........................................................................................................................................

..........................................................................................................................................................

Boolean ............................................................................................................................................

..........................................................................................................................................................

Example ............................................................................................................................................

..........................................................................................................................................................

Logical ..............................................................................................................................................

..........................................................................................................................................................

Example ...........................................................................................................................................

..........................................................................................................................................................
[6]

© UCLES 2024 2210/22/M/J/24


PAGE 70

6 Totalling and counting are standard methods of solution.

Numbers are input. The number 9999.9 is the last number to be input and is ignored.

(a) Write an algorithm in pseudocode to total the numbers input and to output the total.
You do not need to validate the input.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

(b) Write an algorithm in pseudocode to count and output the number of input values that are
greater than 100. You do not need to validate the input.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2024 2210/22/M/J/24 [Turn over


PAGE 71

12

11 A one-player game uses the two-dimensional (2D) array Grid[] to store the location of a secret
cell to be found by the player in 10 moves. Each row and column has 5 cells.

Start
Grid[1,1]

At the start of the game:

• The program places an ‘X’ in a random cell (not in Grid[1,1]) and empties all the other
cells in the grid.
• The player starts at the top left of the grid.
• The player has 10 moves.

During the game:

• The player can move left, right, up or down by one cell and the move must be within the grid.
• “You Win” is displayed if the player moves to the cell with ‘X’ and has played 10 moves or
less.
• “You Lose” is displayed if the player has made 10 moves without finding the ‘X’.

Write a program that meets these requirements.

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to declare any arrays or variables; you may assume that this has already been
done.

All inputs and outputs must contain suitable messages.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

© UCLES 2024 2210/22/M/J/24


PAGE 72

13

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
© UCLES 2024 2210/22/M/J/24 [Turn over
PAGE 73

14

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................. [15]
© UCLES 2024 2210/22/M/J/24
PAGE 74
PAGE 75

DATABASE

PAGE 76
PAGE 77

12

10 A database table called TVRange shows the main features and prices of a range of televisions.

TVCode ScreenSize Satellite SmartTV SoundBar Price$


TV90SaSmSd 90 YES YES YES 9750.00
TV75SaSmSd 75 YES YES YES 8500.00
TV75SaSd 75 YES NO YES 8000.00
TV65SaSmSd 65 YES YES YES 6000.00
TV65SmSd 65 NO YES YES 5000.00
TV65SaSd 65 YES NO YES 5000.00
TV55SaSmSd 55 YES YES YES 4000.00
TV55SaSd 55 YES NO YES 3500.00
TV55SmSd 55 NO YES YES 3500.00
TV50SaSmSd 50 YES YES YES 2500.00
TV50Sa 50 YES NO NO 1750.00
TV50Sm 50 NO YES NO 1750.00
TV40Sa 40 YES NO NO 1200.00
TV40 40 NO NO NO 950.00
TV32 32 NO NO NO 650.00

(a) Give the name of the field that is most suitable to be the primary key.

State the reason for this choice.

Field ..........................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................
[2]

© UCLES 2023 2210/21/M/J/23


PAGE 78

13

(b) The database uses the data types:


• text
• character
• Boolean
• integer
• real
• date/time.

Complete the table to show the most appropriate data type for each field.
Each data type must be different.

Field Data type


TVCode
ScreenSize
SmartTV
Price$
[2]

(c) Complete the structured query language (SQL) query to return the television (TV) code,
screen size and price of all Smart TVs in the database table.

SELECT TVCode, ......................................................., .......................................................

....................................................... TVRange

WHERE SmartTV = .......................................................;


[4]

© UCLES 2023 2210/21/M/J/23 [Turn over


PAGE 79

10

10 A music streaming service has a new database table named Songs to store details of songs
available for streaming. The table contains the fields:
• SongNumber – the catalogue number, for example AG123
• Title – the title of the song
• Author – the name of the song writer(s)
• Singer – the name of the singer(s)
• Genre – the type of music, for example rock
• Minutes – the length of the song in minutes, for example 3.75
• Recorded – the date the song was recorded.

(a) Identify the field that will be the most appropriate primary key for this table.

............................................................................................................................................. [1]

(b) Complete the table to identify the most appropriate data type for the fields in Songs

Field Data type

SongNumber

Title

Recorded

Minutes

[2]

(c) Explain the purpose of the structured query language (SQL) statements.

SUM (Minutes) FROM Songs WHERE Genre = "rock";

COUNT (Title) FROM Songs WHERE Genre = "rock";

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2023 2210/22/M/J/23


PAGE 80

10

10 A database table called Horses stores details about the horses kept at a horse sanctuary.

Code Breed BreedOrigin Gender Age Arrived


H002 Arabian Saudi Arabia M 5 28/09/2022
H004 Percheron France M 5 30/10/2022
H010 Friesian Netherlands M 6 15/11/2022
H011 Fjord Norway F 4 17/11/2022
H012 Clydesdale Scotland M 10 18/11/2022
H015 Arabian Saudi Arabia F 5 15/12/2022
H016 Arabian Saudi Arabia F 5 15/12/2022
H017 Clydesdale Scotland F 4 16/01/2023
H019 Percheron France M 3 16/01/2023
H025 Percheron France M 7 16/01/2023
H026 Clydesdale Scotland F 9 20/01/2023
H030 Clydesdale Scotland M 12 20/01/2023
H032 Fjord Norway M 3 24/03/2023
H033 Arabian Saudi Arabia F 15 27/04/2023
H034 Clydesdale Scotland F 4 14/06/2023
H035 Fjord Norway M 7 15/06/2023
H036 Friesian Netherlands F 15 20/07/2023
H037 Friesian Netherlands M 12 20/07/2023

(a) State the number of records in this database table.

............................................................................................................................................. [1]

(b) Give the name of the field that is most suitable to be the primary key.

State the reason for this choice.

Field ..........................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................
[2]

© UCLES 2023 2210/22/O/N/23


PAGE 81

11

(c) The database only allows the data types:


• Boolean
• character
• date/time
• integer
• real
• text.

Complete the table to show the most appropriate data type for each field.
Each data type must be different.

Field Data type


Breed

Gender

Age

Arrived
[2]

(d) Complete the structured query language (SQL) to return the code and breed of all the horses
whose breed originated in Scotland.

......................................... Code, Breed,

FROM .........................................

WHERE ......................................... = "Scotland";


[3]

© UCLES 2023 2210/22/O/N/23 [Turn over


PAGE 82

12

9 A sanctuary for pheasants has set up a new database table called PheasantList to store details
of the different species of bird at the sanctuary. Part of this table is given, showing: species,
description, number of birds at the sanctuary, if the birds are breeding or not, and number of
young born this year.

Species Description NumberBirds Breeding Young


Edwards blue-black with white tail 5 Yes 0
Japanese green dark green with pale grey tail 2 Yes 2
Reeves golden, white and red scaled plumage 4 Yes 1
Crawfords Kalij glossy blue-black plumage 4 No 0
Crested fireback blue-black with black tail 3 No 0
True silver white laced top half and black lower half 7 Yes 1
Siamese fireback grey plumage with crimson legs and feet 5 No 0
Mikado iridescent plumage with white striped wings 3 Yes 4
Red junglefowl many colours 2 Yes 0
Himalayan monal many colours with metallic green crest 3 Yes 2
White eared white with ear tufts 5 Yes 3
Brown eared brown with ear tufts 9 Yes 1
Ring necked long tail with white ring neck 2 Yes 2
Golden rainbow coloured 3 Yes 4

(a) State the number of records and fields in this part of the database table.

Records .....................................................................................................................................

Fields .........................................................................................................................................
[2]

(b) (i) Give the name of a field that could be used for the primary key.

..................................................................................................................................... [1]

(ii) Explain why the sanctuary might decide not to use the field in (b)(i) as the primary key.

...........................................................................................................................................

..................................................................................................................................... [1]

(iii) A new field SpeciesID is added to the database table.


This field contains a six-character code, for example Ph0001.

Give a reason why this field would be a better primary key.

...........................................................................................................................................

..................................................................................................................................... [1]

© UCLES 2023 2210/23/O/N/23


PAGE 83

13

(c) Write the output that would be given by this structured query language (SQL) statement:

SELECT Species, Description

FROM PheasantList

WHERE NumberBirds > 6;

...................................................................................................................................................

............................................................................................................................................. [2]

(d) Complete this SQL statement to display all the species of pheasant where the birds are
breeding and there were no young born this year:

SELECT ....................................................................................................................................

FROM ........................................................................................................................................

WHERE ......................................................................................................................................

.............................................................................................................................................. ;
[4]

© UCLES 2023 2210/23/O/N/23 [Turn over


PAGE 84

10

9 A database table called SoftDrinks stores details of the soft drinks sold by a small shop.

Field Example data

Name Cola

Supplier Cambridge Beverages

Container Can

SizeCl 330

NumberInStock 30

ReorderLevel 15

Reordered Yes

(a) State whether any of the given fields would be suitable as a primary key and give a reason for
your answer.

...................................................................................................................................................

............................................................................................................................................. [1]

(b) Complete the structured query language (SQL) statement to return the number of cans the
shop has in stock.

SELECT ....................................................... (.......................................................)

FROM .......................................................

WHERE ....................................................... = ....................................................... ;


[5]

© UCLES 2024 2210/21/M/J/24


PAGE 85

10

10 A television subscription service has a new database table named Contract to store details of
their subscribers’ contracts. The table contains these fields:

• ContractNumber – the contract number, for example CT567


• Months – the length of the contract in months, for example 6
• EndDate – the date the contract finishes, for example 30 November 2024
• News – the news service, yes or no
• Movie – the movie service, yes or no
• Sport – the sports service, yes or no
• Junior – the children’s service, yes or no.

(a) Identify the field that will be the most appropriate primary key for this table.

............................................................................................................................................. [1]

(b) Complete the table to identify the most appropriate data type for these fields in Contract

Field Data type

ContractNumber

Months

EndDate

Sport

[2]

(c) Explain the purpose of these structured query language (SQL) statements.

Statement 1: SELECT SUM (Months) FROM Contract;

Statement 2: SELECT COUNT (News) FROM Contract WHERE News;

Statement 1 ..............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Statement 2 ..............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2024 2210/22/M/J/24


PAGE 86

11

(d) Complete this SQL statement to find the contract numbers of the subscribers that take both
the news and sports services.

SELECT .....................................................................................................................................

FROM Contract

WHERE .......................................................... AND ................................................................. ;


[2]

© UCLES 2024 2210/22/M/J/24 [Turn over


PAGE 87

BOOLEAN
LOGIC
PAGE 88
PAGE 89

11

9 Consider this logic expression.

Z = (NOT A OR B) AND (B XOR C)

(a) Draw a logic circuit for this logic expression.

Each logic gate must have a maximum of two inputs.

Do not simplify this logic expression.

B Z

[4]

(b) Complete the truth table from the given logic expression.

Working space
A B C Z

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

[4]

© UCLES 2023 2210/21/M/J/23 [Turn over


PAGE 90

1 Tick () one box to identify the first stage of the program development life cycle.

A Analysis

B Coding

C Design

D Testing
[1]

2 Four logic gates and five standard symbols for logic gates are shown.

Draw one line to link each logic gate to its standard symbol. Not all standard symbols will be used.

Logic gate Standard symbol

AND

OR

NAND

NOT

[4]

3 Identify three different ways that the design of a solution to a problem can be presented.

1 .......................................................................................................................................................

..........................................................................................................................................................

2 .......................................................................................................................................................

..........................................................................................................................................................

3 .......................................................................................................................................................

..........................................................................................................................................................
[3]

© UCLES 2023 2210/22/M/J/23


PAGE 91

(c) The algorithm does not check that each input is a single digit.
Identify the place in the algorithm where this check should occur.
Write pseudocode for this check.
Your pseudocode must make sure that the input is a single digit and checks for –1

Place in algorithm .....................................................................................................................

Pseudocode ..............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

8 Consider this logic expression.

X = (A OR B) AND (NOT B AND C)

Complete the truth table for this logic expression.

Working space
A B C X

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

[4]

© UCLES 2023 2210/22/M/J/23 [Turn over


PAGE 92

9 Consider the logic expression:

Z = (A NAND B) OR NOT (B XOR C)

(a) Draw a logic circuit for this logic expression.

Each logic gate must have a maximum of two inputs.

Do not simplify this logic expression.

B Z

[4]

(b) Complete the truth table from the given logic expression.

Working space
A B C Z

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1
[4]

© UCLES 2023 2210/22/O/N/23 [Turn over


PAGE 93

6 There are three descriptions of logic gates. Each logic gate has two inputs A and B with one
output X.
Identify each logic gate.
Complete a truth table for each logic gate.

(a) The only time the output is 1 is when both inputs are 1.
A B X
Logic gate ...............................................
0 0
Complete the truth table for this description.
0 1

1 0

1 1

[2]

(b) The output is 1 when both inputs are different.


A B X
Logic gate ...............................................
0 0
Complete the truth table for this description.
0 1

1 0

1 1

[2]

(c) The only time the output is 1 is when both inputs are 0.
A B X
Logic gate ...............................................
0 0
Complete the truth table for this description.
0 1

1 0

1 1

[2]

© UCLES 2023 2210/23/O/N/23


PAGE 94

(d) Consider this logic expression:

X = (NOT A OR NOT B) OR NOT C

Draw a logic circuit for this logic expression. Each logic gate must have a maximum of two
inputs. Do not attempt to simplify this logic expression.

B X

[5]

7 A program uses both local variables and global variables.

Describe two differences between local variables and global variables.

Difference 1 ......................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Difference 2 ......................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[4]

© UCLES 2023 2210/23/O/N/23 [Turn over


PAGE 95

8 Consider the logic expression:

Z = (R OR NOT T) XOR (NOT S AND T)

(a) Draw a logic circuit for this logic expression.

Each logic gate must have a maximum of two inputs.

Do not simplify this logic expression.

S Z

[5]

(b) Complete the truth table from the given logic expression.

Working space
R S T Z

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

[4]

© UCLES 2024 2210/21/M/J/24 [Turn over


PAGE 96

1 Tick () one box to identify a method used to design and construct a solution to a computing
problem.

A analysis

B coding

C flowchart

D testing
[1]

2 Four logic functions and five standard symbols for logic gates are shown.

Draw one line to link each logic function to its standard symbol. Not all standard symbols will be
used.

Logic function Standard symbol

AND

XOR

NAND

OR

[4]

3 Identify three different tasks in the analysis stage of the program development life cycle.

1 .......................................................................................................................................................

..........................................................................................................................................................

2 .......................................................................................................................................................

..........................................................................................................................................................

3 .......................................................................................................................................................

..........................................................................................................................................................
[3]

© UCLES 2024 2210/22/M/J/24


PAGE 97

8 A logic circuit is to be built to control the opening of a safe used to store money. There are two
keys, A and B, and a time switch C. The safe can only open if both keys are used and the time
switch is off.

not used 0
key A
used 1

not used 0
key B
used 1

switch off 0
time switch C
switch on 1

safe cannot open 0


safe X
safe can open 1

(a) Write the logic expression for this problem.

............................................................................................................................................. [3]

(b) Complete the truth table for this problem.

Working space
A B C X

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

[4]

© UCLES 2024 2210/22/M/J/24 [Turn over

You might also like