0% found this document useful (0 votes)
31 views14 pages

CS P2-Mocks

Uploaded by

itzmebarirah
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)
31 views14 pages

CS P2-Mocks

Uploaded by

itzmebarirah
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/ 14

TERNATION, PAKISTAN INTERNATIONAL SCHOoLJEDDAH ENGLISH SECTION

Mock Examination 2023-24


ADDAH"

Rehan |671|
CANDIDATE NAME: Adeena STUDENT ID:

Grade: Y10 - Duration - 1hour 45 minutes

0478/22
COMPUTER SCIENCE
|7 Mar-2024
Paper 2 V2 Algorithms, Programming and Logic
Candidates answer on the Question Paper. Obtained
No Additional Materials are required. Q.no. Marks Marks
No calculators allowed. 2
1

INSTRUCTIONS 2 4

" Answer all questions. 3 4

" Use a black or dark blue pen. You may use an HB pencil
for any diagrams or graphs. 5

" Write your name, centre number and candidate number in 6


the boxes at the top of the page.
7
" Write your answer to each question in the space provided. 8
" Do not use an erasable pen or correction fluid.
9 8
" Do not write on any bar codes. 10 11
" Calculators must not be used in this paper. 11 15
INFORMATION Total 75
"The total mark for this paper is 75.
Marks %
" The number of marks for each question or part question is
shown in brackets []
or hardware.
" No marks will be awarded for using brand names of software packages
INTERNATIONA
SCHOÇ0,
Examiner'sSignature:
PC

Moderator's Signature:
JEDDAN
Exeellence Ia Educetien
Invigilator's Signature:
Exam Depart:nent

This document consists of 16 printed pages including the cover page.


Y10-CS 0478 Mock Exam-2023-24 P2V2
2

or egualto 3 .F o uprs e u d o c

operator means less than


which
box toshow
li

(/)one one

1. a)Tick Draw

N oa
t lp
l se
(a)

A OR

<
B

<=

procedure.
be passed to a
() one box to
show howa value can
b) Tick

A function

B parameter

returm

subroutine [1]
datathat could be used to
data and one pjece of erroneous test
Z. Give one piece of normal test
validate the input of an emailaddress.
State the reason for your choice in each case.

Normal test data sambridge.u. 2024 gnal:som.

Reason lt has 8- 209.charg sters...nd..consists..a...seecial..symbds.


for gmals..(Q)..an. d. also....ends...ith. an
.adres..ype....gmail:. oml.

Erroneous test data ..Pisies. l3. com. email

Reason.E..doe...not... tollou...the..torma...ol an emil ..addres.. and


Uses
in the and coec hot
include he..(Q. ssbol.

[4)
Y10-CS 0478 Mock Exam-2023-24 P2V2
JIDDA
3

3. Four pseudocode statements and five pseudocode uses are shown

(a) Draw one line to link cach pseudocode statement to the most
appropriate pseudocode use.
Not all pseudocode uses will be required.
Pseudocode statement
Pseudocode use
CALL Colour (NewColour)
counting
Value (A1 + A2 + A3) / 3 finding an average

totaling
Loop1 t Loopl + 1
using a conditional
statement
IF Count > 7 THEN X1 0
using a procedure
[4]

4. Describe what is meant by the terms variable and


constant and give an example of each in vOur
answer.

Variable .... Variable. .meaningtul. identitier..n....Proqram.


which.stores

.spesits...ar.....ogramn,..a.broughout....he...proqam..
h..wale.Ldata. stoud within .a..ariade..can...chag.haout,..the. ..n.pram.
Constant....constan.s....*Aningtel..dentihr..in..prog a m.
which.. stoEs.apeati..latasncd.ays...onsisteat.thnughou.
the -prgam..E does....no.varg...a.. al.

14]

I N T ENATION,
A

lion
Exrellencela duce

Y10-CS 0478 Mock Exam-2023-24 P2V2 Exam Depart:ncni


4
5. An countries to
algorithm has been written in pseudocode toallow the names of 50 cities and their
be entered and stored in a two-dimensional (2D) array. array are thenoutput.
The contents of the
Ol DECLARE City ARRAY Ll:50. 1:21 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]
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 ", CitylOut, <]
14 NEXT Out

(a) ldentify the four errors in the pseudocode and suggest corrections.
Error 1 ......5.

Correction REPEAT.

Error 2 o7

Correction ..JNPUT.Gity.Cont,.1]..

|2
Error 3

Correction..FoR Out & 1 10 o.

Error 4

Correction.ECLARE..City...ARRAY CI:50 :2] OFSTRING" .......!

[4)

SCHOO,

JEDDA
Y10-CS 0478Mock Exam-2023-24 P2V2 Excellence la E ducetion

Ex:nDenrnent
5

name of a
to the corrected algorithm to allow the
(b) Describe the changes you should make
stored cities from that country.
country to be input and to display only the
Youdo not need to rewrite the algorithm.
city, .using. variables.
lWe..ull .ouLpo.the..name...the.
...he...ename....the..coUny.s..entered.in. CCount,2]..as inine..
04
the variahle ount to..output the....
then..we......4N,. USe

cby. 4s.... Ccount,,1].


lhere.......9n. ......sperate..A for..Gky...and. CountriesS:..
Can be.. stored in.the. variable. and.
ide
Ihe.name ot he..ontry.
that variable Can beUsd output the Ctes..aray..."
...*. .. ..

ás....... ..wod..betonespondng.
3....h..y..ame... Can be taken as.
Inine. ......

takiog Country .name..4...nput. This would

hmean that lines6 and 07. are ne.longer..24 uired.


[5]

variables and global variables.


6. A program uses both local
variables and global variables.
Describe two differences between local
Used tor a
Difference 1 local. variable.. is. theVariable which is
ce tai.part.....e..Ogrm.hereas..globa..ariables, are Useel

thou ghat......rgTArt:.
..

while
Difference 2 local.. yargbles. are...made...doring..he..program.

qloba.. vat iables .Qre..pre-deined.

[41

Y10-CS 0478 Mock Exam-2023-24 P2V2


JEDDA
Excellence laEducation

ExamDepart:nent
6

find if a batch of parts has been manufactured


7. This is an algorithm to

START
successful y.
Accept c 0
Reject + 0

INPUT PartOK

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

|Yes

Accept Accept + 1

No
IS Accept
= 10 ?

Yes

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

OUTPUT
QUTPUT "Too many rejected
"Success" Error, " error"

STOP

INTE
(a) Complete the trace table using this data:

Acept Reject PartoK Error OUTPUT

33$ N

NTER
NATION

N
JEDDAN
Excellence Ir fduce tion

Exnn Depar.nent
Too many rejected
20 7. error.

[5]

(b) Describe how the algorithm should be changed to accept Yor 'y' for a successfully
manufactured part.
As Soon .4s..h..inpu...is.laken.th UCASE Funcion can

INPUT UCASE (Part c) OR Soon 4s the


be...e.,.:4+
input..is. talen the LCASE knctian Can be usecl to ate
all inpts j .NPUT UASE (Partox).
louercase. ,.l:4..:...

[3]

Y10-CS 0478 Mock Exam-2023-24 P2V2


8. An
algorithmallhas been written to:
a
Set 50elements of the arrav Reading[1:50] to zero
b
input values between 35 and 50 inclusive
C valid numbers have been enteleu
dne process when an innut of-1 ie modo or 50
d. reject all other values
e. Countthe number of times each valid value is input
been input. starting withthe lowest value.
pulne number of timeseach valuehas
f.
Complete the pseudocode algorithm:
01 FOR Count TO 50

02 Reading[Count] 0
03 NEXT Count

04 Count 1

05 OUTPUT "Please enter next reading

06 INPUT Value

07 REPEAT

08 IF Value < 35 OR Yalve > 50


09 THEN

10 OUTPUT "Reading out of range"

11 ELSE

12 Reading [Value ] Kesding.LVale..


13 Count = Count + 1

14 ENDIF

15 IF Count <= 50

16 THEN

17 OUTPUT "Please enter next reading

18 IN PUrYalue.
19 ENDIF

20 UNTIL Value = -1 0R Count > 50


21 Count 35
22 REPEAT

23 OUTPUT "There are Coyn


readings of ", Count
24 Count Count..t..
25 UNTIL Count > 50 s.5CHOO,

Y10-CS O478 Mock Exam-2023-24 P2V2

JEDDA
Excellence In tducetion
9 Consider the logic expression

Z= (A NAND B) OR NOT (B XOR C) JEDDA


Excellence In tduca tie1

(a) Drawa logic circuit for this logic expression. Exan1 [Depart.ncnt
Each logic gate must have a maximum of two inputs.
Do not simplify this logic expression.

N
B

(b) Complete the truth table from the given logic expression.

N
A B C Working space

0 1

1 1

1 1

1 0
1 1 1

Y10-CS 0478 Mock Exam-2023-24 P2V2


Y10-CS
Give This silver
True 6 young
description, ofT0.
(iii) (i ) (b) (a) Himalayan
monal o s Reeves Edwards
record. Goldennecked eared White
Ring Brown eared junglefowl Siamese
fireback
RedMikado fireback
Crested Japanese
green the A
a field new A Explain (i) State CrawtordsKalij sanctuary
0478 reason Give Fields
Species borndifferent
containsa Records
Mock hey..e.
field dterent the
I why the this
number
why number
SpecieslD name year. species for
xam-2023-24 ill this
the
n:epetiti.an.d..nigue. six-character sanctuary pheasants
of
field of rainbow long brown white many colours
ofcoloured many
iridescent blue-black
grey white blue-black
plumage dark
glossygolden, blue-black
also is rd. a records birds of
would adaed field tail plumage lacced green bird
not..tolloung.
lengts. with
with withcolours
white at
might Species that ear ear plumage
P2V2 all be code,
14and
top with with with the athas
to could white the
a the decide fields tufts tufts with with half black and Description set
be better l pale white sanctuary,
or
fdatabase ring metallic wicrimson
th red sanctuary. up
is..aso. be and tail
example in neck scaled grey tail a
in primary not used this white black
a tail new
the for part green legs if
table. certain use to striped lower plumage the Part
database
the and 10
key.Pho001. kely..to the of crest
same the
birds of
pattern field primary wings feet half this
database are table
format. he in table
idotik.cach. (b)(i) key. breeding
NumberBirds
Breeding
Young called
is
names as table. 3 2
xcellence
tdceila In as 9 5 3 3 given,
5 7 3 4 4 2
they 5 or
JLDDA the PheasantList
not,
showing:
ONA,
beare.primary
and
rpeted Yes Yes Yes Yes Yes Yes
ot. key. Yes No Yes number
No No Yes Yes Yes species, storeto
of
2 1 3 2 detai
4 1
[1] [1] (2] 1 2
()
WHERE FROM SELECTbreeding (d) PheasantList
Description
FROMSpecies,
SELECT
Complete WHERENumberBirds
True..tver...white 6:
> Lte
Br.eared
own.
and
the
output
PheasantListSpeies. there this
Breding.:.Jes.AND.ong,0,. SQL that
were
statement would
no
young brouun
with be
to given
born display laced
by
this
this
year: all ear
the structured
top 11
species
tofts half
query
of
pheasant and language

where black
(SQL)
the lower statement:
birds
ellce are halE
TLONA,NTE
JEDDAIn
t
dwcerian 008)> [2]
[4]
Y10-CS 11.
The For The and The quotation:array
DELARE R.
.RLength.0.
kenge.l.. You voutput
store Mnput
theVcalculate theVoutput Vinput
calculate Write type The Quotations]
koom. inputsAll You done. You mustcontinue check " " "
do calculated room choice
woodexample,index rom floor price length
" area" width
0478 Widh.0... wil aand data Customers). A
not all the
the an
a WOod
and need use to
that newprogramprice are
choices
measurementsof
measurements of of of of of
Mock th
data choicee theerroreach any
to
outputs pseudocode
need accept customer's stored a wood woodwood room room
price price
in areacustomer's in flooring
:"STRING"
Name initialise to the message that their customer A
xam-2023-24 of
measurement availablecustomer's requiredrequired (one (one
declare of of of Index index
must
the relevant wood 3 2 1 two-dimensional
the the the meetsarrays two in
decimal company
WoodType[] quotation
next must(room decimal
contain or wood wood and room and name, 1D are: named data (whole
in
(rounded
any customer. e
thshare
program array find arrays be dollars
length
arrays needed requireby room isfollowing stores
P2V2
required to Wood
type between
number) place)place)
TPice .9.-Room..9..
Wood.Choice. its
multiplying valid the Laminate inthe is
up
.. loomHrea osutable and include: named Oak Pine index and (two
or
code price the length same same to
(2D) the
Pricel]
variables; measurement requirements: 5 decimal next
4 1.room
per
arraynames
messages. and the and WoodType] index in
of and
square together both whole 12
add name room Quotations]
number.
Customers/] 10.0width)places). of
you Price up
comments of metre the width arrays. are number)
may to and inclusive. to
the taken
length be per 100
assume customer, Price[]. corresponds stores
re-entered 54.99 39.99 29.99square in
woodPriceTotal-
&o to of customers
explain the The metres. details
that the metre
room until index
this hoW choice to All oalnsioneendim- (1D) ina
of
and it ($) the each
has your is of floors
the valid the data
already of customer's
code wOod width wood are
in
index
rectangles
works.
been and of

4
of

JEDDA
ISTANN,
NTER
TIONA,
..... wHILE
CoPLS Price.L23s
S29.q9
39.44 Pricel1]CJsLaminate
Wood Abod lNoygeod
Y10-0S
OUT
Tape ype
UNTIL INPUT INPUT
REPEAKe04 Name
0478 REPEAT
Room.Lengt.s.RoUN!
ENSIF
IFRomLeng OUT PUT
LSl- [21<
I/UNTIL PUT Roorm
INoUI THEN Customers /
Mock ENOIF OUT OT
RoomidHhoR sa).5IE Room INPUT
S Ronwidth Keom,
THEN PUT efRoom- Enter "Oak""Ping"
-2023-24 "IANalid
OUTAUT length Plea
WidthR-width Length
Lengt.
Enter Rasm t Length se name
OUTPUT"d < is enter
*Rootwidt width ,
RoUNO he ]:5 ot to is
P2V2 A o t t a n rtnter C....0Unaling.to..4..decim ls
KLength 1) room your.nan.. be to
\nvalia(Ruidth, idh AND.Room-Length.
Room.Length
lo.00 OR be
Room.width lo.00
AMD measurenents.re-ent.. input,
Room-width of taken 13
orements,
meas
1) the rounded
rom input
0.00 al to1
place lo.00
***.
deima
and
place.
validation
andwaliduted

n ErrrlEllseoerinceenIa
JEDDAM
Y10-CS
ENDIE. ENDwHILE.
IE..Customers....loo4.
OUTPUr"
wocd0UTPUT.
OUPUCustom Quotatians
Qucta Quotation
THEN Qotition!3...Kon-Length.
Quotations..El9,Stoing.
Calculating...he.
IPrice.s.Rom-Area.Price.btalwWad [und. OUTPUT" **..*..
0478 1/ UNTIL ENDIE.
....eking....n.pu.... REPEAT
INPUTchaise..f..
tions OUTPU Rom-eUPUI Reom
Mock loo, Lloo, s THEN
hechasen.4A.e.isi.y..ocl The Lloo,
Pice.....RoUNSCI wod-Choe
Wod.Choic..<...0R
Choie....3. Areg
Lloo the. Price...of...wocdis"
wbod- bdade Area.RoUNPfA-Ro/
A.lam
Custoners.e.
2023-24 s] 2] k
4]bPe.Wd-Chice
er..Name...is.44stoer
ota!prige l]. 3] OUPUTEnter.....494....
4 data.in..the..anay heice ROuNDUP k
>=1
Total. Room Rcom ROUN Reom
total
-width
.Ne...cwthin (A-Room)
P2V2 AND Leng
WoYice .Pris..c.swoocl...and.undns..
rea Pie,deimal..plae 2 (WodChoice,.O). choiwsodce ef
he Prie th
sood. Wacd-Choje..
2.)... [ubd-Choice Room
rarge. Room
is:Total. and.fnding..pre.
wood
3. Width. Aea. 14
erter numbers
mhdlein

yp..Load. J. valve
calulation
ubd
betwpen
Pice.Choicg,. randina....neat.bwhole
nvbe
end.
ence

DDAM
la and.3" 1
duca

tiem

You might also like