TAK-2210 - w23 - QP - 22 by Sir Aqib Khan
TAK-2210 - w23 - QP - 22 by Sir Aqib Khan
TAK-2210 - w23 - QP - 22 by Sir Aqib Khan
Nov. 2023
-
-
HELLO! I AM
WHO IS
AAQIB KHAN?
Sir Aqib Khan is not only a teacher for his students but also a door to
success. His master's degree in his subject shows his
perfection when he is standing on rostrum and delivering his words, his
knowledge to his students. This not only gives students supremacy over the
subject but also the courage to rock the paper.
Sir Aqib's distinctive style of teaching, as he calms down the students and
tells them, "Bachun mein Hun na Sab thek hojayega" provides the students
a sense of strength and make them focus on their studies. To help his
students sir Aqib has also given them the recordings of his lectures so for self
study they always have sir Aqib Khan. Students have so much connection
with sir Aqib Khan that they know whenever they need him he is just a mes-
sage away.
Sir Aqib has always been a friend and a brotherly figure towards his
students. There is no need to say much about sir Aqib Khan because his
work and utmost his students results not only in computer science but also
in practical life tells all of it
WWW
CS By AQIB Khan
QUIZ WORKSHOP PODCAST SERIES
TheAkikhan.com
031450530717 TheAkikhan.com
O Level - Past papers By Sir Aqib khan
CS BY AAQIB KHAN
Cambridge O Level
ADiB KHAN
* 8 0 3 0 7 1 0 0 6 9 *
011010101101010110101
INSTRUCTIONS 10110101101011010110
Answer all 1011010110
questions. 1011010110
Use a black1011010110
or dark blue pen. You may use an HB pencil for any diagrams or graphs.
1011010110
Write your name, centre number
10110101101011010110 and candidate number in the boxes at the top of the page.
10110101101011010110
Write your answer to each question in the space provided.
Do not use1011010110 1011010110
an erasable pen or correction fluid.
Do not write on any bar codes.
Calculators must not be used in this paper.
INFORMATION
or
AAQIB KHAN
The total mark for this paper is 75.
The number of marks for each question or part question is shown in brackets [ ].
No marks will be awarded for using brand names of software packages or hardware.
DC (LK) 333552
© UCLES 2023 [Turn over
O Level - Past papers By Sir Aqib khan
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.
I
(a) State the type of validation check used.
RMAT Check
............................................................................................................................................. [1]
0110101
(b) Give one 01101010110101
example of normal test data and one example of abnormal test data you should
use to 1011010110
make sure the1011010110
check in part (a) is working properly.
10110101101011010110
State a1011010110
reason for each 1011010110
of your choices of test data.
10110101101011010110
10110101101011010110
Normal1011010110 30/1/1990
......................................................................................................................................
1011010110
Date is written in Cossect
Reason .....................................................................................................................................
FORMAT (Accepted)
...................................................................................................................................................
wamy/2024 30
Abnormal ..................................................................................................................................
AAQIB
MONTH
Collect KHAN
notwritten is in
Reason .....................................................................................................................................
Fromad (Rejected)
...................................................................................................................................................
[4]
(c) Describe how a length check could be used with the date entered.
iN TOTAL
...................................................................................................................................................
genteg/too
if short
* Be"
->
...................................................................................................................................................
it
............................................................................................................................................. [2]
3
To TOTAL
N +
CS BY AAQIB KHAN
(a) Draw one line to link each pseudocode statement to the most appropriate pseudocode use.
:
finding an average
b Value (A1 + A2 + A3) / 3
totalling
(+N)
C - Loop1 Loop1 + 1
--
using a conditional statement
Empfantunts
Write a1011010110
pseudocode1011010110
S
⑭
algorithm using a single loop to find the lowest value in this array and -
...................................................................................................................................................
AAQIB KHAN
SMALLE 100 19
Site
-
...................................................................................................................................................
FOR INDEXE U To 25
1IF
...................................................................................................................................................
tEmpERATRES/INDEx) smi
...................................................................................................................................................
THEN
...................................................................................................................................................
SMALLETEMPERATURES
...................................................................................................................................................
ENDIF
...................................................................................................................................................
INDE
...................................................................................................................................................
Ipats]
...................................................................................................................................................
"LowestTemp"
output
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
© UCLES 2023 2210/22/O/N/23 [Turn over
O Level - Past papers By Sir Aqib khan
4 -05,07,
inee
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.
CS BY AAQIB KHAN
X01 DECLARE 6.
City ARRAY[1:50, 1:2] OF BOOLEAN
02 DECLARE Count : INTEGER
v
~
03 DECLARE Out : INTEGER
-
04 Count 1
1
05 IF
x
06
REPEAT
OUTPUT "Enter the name of the city"
*07 - INPUT City[Count, 2]
W 08 OUTPUT "Enter the name of the country"
- 09 INPUT City[Count, 2]
10v Count Count + 1
X11 UNTIL Count 7= 50
X 12 FOR Out O 5
1 0
1 TO x
13 D 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 .......................................................................................................................................
0110101
Correction 01101010110101
.................................................................................................................................
10110101101011010110
10110101101011010110
...................................................................................................................................................
10110101101011010110
Error 21011010110 1011010110
.......................................................................................................................................
1011010110 1011010110
10110101101011010110
Correction .................................................................................................................................
...................................................................................................................................................
Error 3 .......................................................................................................................................
AAQIB KHAN
Correction .................................................................................................................................
...................................................................................................................................................
Error 4 .......................................................................................................................................
Correction .................................................................................................................................
...................................................................................................................................................
[4]
5 LINEAR ScaRCH
(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.
CS BY AAQIB KHAN
You do not need to rewrite the algorithm.
INPUT AND
prompt
to ASK FOR
COUNTRY
...................................................................................................................................................
TO BE SEARCH B/W LINEno.
...................................................................................................................................................
II and 12
...................................................................................................................................................
...................................................................................................................................................
IfitdoES, Allow THE
Output
...................................................................................................................................................
011010101101010110101
in 1011010110 LiNE 13.
1011010110
...................................................................................................................................................
10110101101011010110
itdoes
If 10110101101011010110 notcheck For Next
...................................................................................................................................................
10110101101011010110
Element 10110101101011010110
.............................................................................................................................................
10110101101011010110 [5]
5 -
Explain how variables and constants should be used when creating and running a program.
->
VaRiables aN CONSTANT should have
..........................................................................................................................................................
->
during STOREDATATHAT
CONSTANT
THEExecution
of I
SROGRAM
..........................................................................................................................................................
CAN NOT
.................................................................................................................................................... [3]
CHANGE
DURING THEEXEcution
of
pRogRAm
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.
CS BY AAQIB KHAN
START
Total 0
OUTPUT
"Average is ",
Average
Count 0
INPUT OUTPUT
Value "Total is ",
Total
011010101101010110101
10110101101011010110
10110101101011010110
10110101101011010110
IS Yes
10110101101011010110
Value = Average Total / Count
10110101101011010110
0 ?
10110101101011010110
No
IS Yes
Value = STOP
AAQIB KHAN
–1 ?
No
Count Count + 1
CS BY AAQIB KHAN
25, 35, 3, 0, 57, 20, 25, 18, 0, –1, 307, 40, 0
011010101101010110101
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
AAQIB KHAN
(b) Describe the purpose of the algorithm.
[5]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
SUBSTRING
->
-> LCASE 8
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
CS BY AAQIB KHAN
position 1.
Gre
Write pseudocode statements to:
• store the string "Learning Never Exhausts The Mind" in Quote
• extract and display the words "The Mind" from the string
ijri
• output the original string in lower case.
"Lg
..........................................................................................................................................................
-
..........................................................................................................................................................
..........................................................................................................................................................
STARTE 25
..........................................................................................................................................................
8
NumBERE
..........................................................................................................................................................
Output SuBSTRiNG/te, T, if
..........................................................................................................................................................
..........................................................................................................................................................
011010101101010110101
penT
10110101101011010110 LCASE(QuotEl
..........................................................................................................................................................
10110101101011010110
10110101101011010110
..........................................................................................................................................................
10110101101011010110
10110101101011010110
..........................................................................................................................................................
10110101101011010110
..........................................................................................................................................................
.................................................................................................................................................... [5]
ValuE TOuNsFessed Blw module
AAQIB KHAN
8 -
Explain why a programmer would use procedures and parameters when writing a program.
PROCEDURE
-
..........................................................................................................................................................
BE RE-USED
1) To
procedures
allow to
..........................................................................................................................................................
with iN
PROGRAM
OR iN OTHER
plogRAm
..........................................................................................................................................................
To MaKE easieR To
2)
PROGRAMS
..........................................................................................................................................................
MAINTAIN due to less Code
..........................................................................................................................................................
3) TO ENABLE
DifferentProgrammERS To
..........................................................................................................................................................
WORK ON
DifferentProceduRES in SAmE
..........................................................................................................................................................
PROJECT
.................................................................................................................................................... [4]
PARAMETER
PASS B/W Fructor/posed
- ALUE Main PJOgRAm To
© UCLES 2023
So
parameter
2210/22/O/N/23
CAN BEUSED IN
Func/poosed
O Level - Past papers By Sir Aqib khan
CS BY AAQIB KHAN
Z = (A NAND B) OR NOT (B XOR C)
B Z
011010101101010110101
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
C 10110101101011010110
10110101101011010110
[4]
(b) Complete the truth table from the given logic expression.
AAQIB KHAN
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]
10
10 A database table called Horses stores details about the horses kept at a horse sanctuary.
CS BY AAQIB KHAN
AAQIB KHAN
(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.
Field ..........................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
[2]
11
CS BY AAQIB KHAN
• 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.
Gender
Age
Arrived
[2]
AAQIB KHAN
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
CS BY AAQIB KHAN
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[]
AAQIB KHAN
• 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.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 2210/22/O/N/23
O Level - Past papers By Sir Aqib khan
13
..........................................................................................................................................................
CS BY AAQIB KHAN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
011010101101010110101
10110101101011010110
..........................................................................................................................................................
10110101101011010110
10110101101011010110
..........................................................................................................................................................
10110101101011010110
10110101101011010110
..........................................................................................................................................................
10110101101011010110
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
AAQIB KHAN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
© UCLES 2023 2210/22/O/N/23 [Turn over
O Level - Past papers By Sir Aqib khan
14
..........................................................................................................................................................
CS BY AAQIB KHAN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
011010101101010110101
10110101101011010110
..........................................................................................................................................................
10110101101011010110
10110101101011010110
..........................................................................................................................................................
10110101101011010110
10110101101011010110
..........................................................................................................................................................
10110101101011010110
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
AAQIB KHAN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................. [15]
15
BLANK PAGE
CS BY AAQIB KHAN
011010101101010110101
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
AAQIB KHAN
16
BLANK PAGE
CS BY AAQIB KHAN
011010101101010110101
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
10110101101011010110
AAQIB KHAN
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.