0% found this document useful (0 votes)
3 views4 pages

NW Al CSC P3 2024

This document outlines the instructions and requirements for a mock examination in Computer Science for advanced level students in Cameroon. It includes guidelines for candidates, such as prohibited items, tasks to complete, and programming-related questions. The examination focuses on data structures, algorithms, and programming languages, specifically requiring students to implement various procedures and functions.

Uploaded by

ndzijioromeo
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)
3 views4 pages

NW Al CSC P3 2024

This document outlines the instructions and requirements for a mock examination in Computer Science for advanced level students in Cameroon. It includes guidelines for candidates, such as prohibited items, tasks to complete, and programming-related questions. The examination focuses on data structures, algorithms, and programming languages, specifically requiring students to implement various procedures and functions.

Uploaded by

ndzijioromeo
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/ 4

«

— I*
for more past questions and solutions download kawlo kawlo app or visit http://www.gcerevision.com

**PMIltf|LJR III* t A M M t H l N
» thi ¥Mt
^Vf
MMHMrfrt I » r % INHU JNIMTHP \ H

f
*
tUUU 1 » Afrill A I ACMON frOAfeOGtQUt
ANIINNI RfukTNAIf DV N( >UD OUtlt
btfht
*
ONI JAIK » %
REPUBLIC Of CAMEROON
/Vo** - JfforE / athfrland

MINISTRY Of SECONDARY EDUCATION

TEACHERS ' RESOURCE UNIT


REGIONAL BRANCH FOR THE NORTH WEST
c.

fir J i m MANf < IN R AMENDA r.O. BOX 2183 MANIC ON 6AMFNDA


W JM SfijX TCL 233 362 209
*
MARCH :o.N
l M U »n t l t i t H i t! * > ( M l< iRFyi|
’ |H H I < O \A
ATVE I
Cmall : irutyjmendafryahoo.co.uk

The IcarhrtV Knouiti Unit anil| R Reglmiiil


| SUBJECT CODE PAPER NUMBER
Inaprrtmale nf Pedagogy In collaboration with NUMBER 3
COSTA 0795

.
GENERAL CKRTTPK ATE OF EDUCATION

)
RKC IONAI . MOC K EXAMINATION SUBJECT TITLE

om
. . ..
COMPUTER SCIENCE
ADVANCED LEVEL

.c
Time Allowed: TWO HOURS
INS!RUCTIONS TO CANDIDATES

n
Mobile phones arc NOT ALLOWED in the examination room .

io
Answer miy four quewlions
Two Hour*
is
INSTRUCTIONS
ev
• ( 'tvry out All. the tasks given, For your guidance, the approximate mark for each part of a task is indicated
in hrat kefs .
Importance i * attached to accuracy , layout and labeling of drawings and computer-generated outputs.
r

• ( treat
ce

• You arc reminded of the necessity for good English and orderly presentation of your answers.
• Write algorithms In ihr answer booklet provided. Also record in your answer booklet any information
(g

requested or that you believe would mukc it easier to understand how you carried out tasks or answered
questions , . # < ,,
LO

• You are expected to print out a single copy of relevant fragments of your program at different times. Please
notify the inatructor of any required printout that was not done.
w

• When an imperative programming language ( PL ) is required to write program code, cither Standard [ ISO]
W

Paaral or the|ANSI|C or Cl I programming language Standards may be used.


.
If need be supervisors will assist you in recording details of intermediate work carried out on the computer .
KA


• Do not write on the first page of your answer booklet . It is reserved for administrative purposes.
• Where information is provided as soft copy, notify the instructor if it is not found in your machine or has not
been made available to you .

ciHti/* ri/* J* vr2/ M *


Thh document h the pr«P r*
( )( 2024
.
y of Ihr T /W and Ihr In prrloralr of Prriagogy and
'
TURN OVER
hr reproduced without Ihr prr minion of ihr author I

for more past questions and solutions download kawlo kawlo app or visit http://www.gcerevision.com
1 JU
marks )
jUMiisMiuJBammiMi
for more past questions and solutions download kawlo kawlo app or visit http://www.gcerevision.com
SECTION A : glfl
, ,
fS „ om ( AFCON
2023 ) was awarded Kory Co
then required software that**Will'
-
. . ( in » of ( ho 34 edition
of the ovember , 2022. CAF /
. <f i s e W t t J B S4 « isi
tI

f W r W/ < f' A f > S w


„ “v i f e i
, y
,L
« T T7below
SU* « d » «

internship has been awarded the


» »
,
F reject .
*
•descr bed ^ "

Project Role and Rcipomlbilltle* t do the following:


project tr enter the names of qualified teams in the order in which they
. of
You arc expected us part the
implement a module that will alio ' ‘
qualified.
* '
(0

• Implement n module that fixtures for the qualified teams, and prim them for
Implement a module Ihnt w*

-
• . i
publishing to the public
,
dr wing up fixture. before the
star of the compe i i , , , „„ and
^

)
om
the qualified leums ,
I Came Fixture? .in which they qualified is shown in the figure below. This
order m
Assumption : Only 12 teams can participate and the
information will be stored in a dotn structure with the
name QUALIFY .
QlllJitl45lJ«fllM.tJLQJil«

.c
Nigeria Man Cameroon Guinea

^— jvoryCoait
Ghana Sonogal Tunisia Egypt Zambia
[counlnelj Morocco Algorfo

n
3 9 10 11 12
4 i 0 7
[n dices ] 1 2 3

io
t
Figure 1

NB: write Ivory Coast as IvoryCoast for simplicity .


stored as shown in the figure
To draw up the fixtures, 12 unique random numbers [ 7 to 12\ should be generated and
is
will generate. This
below. The numbers ( random numbers) indicated arc not the same as those your program
ev
information will be stored in a data structure with the name “ GROUP”.
in
This means that , once a number is generated randomly, it must be verified that the number does not already exist
the data structure “GROUP” before it can be stored . The algorithm in figure 3 can be used for this .
r
ce

Random 10 3
Numbers
5 11 Index
Figure 2
(g

The fixtures shall have THREE Groups with FOUR Teams in each group.
The logic of the grouping is that the random numbers , 5, 12, l ] in the first four index positions [ 1, 2, 3, 4] offigure
^
2 gives GROUP A ( header ** GROUP A **), while the next four gives GROUP B [ header. ** GROUP B **), and the
LO

last four gives GROUP C( header: * * GROUP A ** ).


To select the countiies for a group, pick a random number from figure 2, compare it with all the indices in figure I .
If they correspond , then the team in figure lat that index position is added to the group. The skeleton pseudocode
below can be implemented for generating random numbers and for printing the group fixtures.
W

12 Unique Random numbers generation FORi «- l to 12 do


KA

Flint group(s ) header based on appropriate condition


FORi l to 12 do
(le if i = 1 or if i = 5 or if i = 9)
Generate between 1 & 12 . store in N
/=1 1
not
- -
FOfcj « \ to 12 do
IF 1 5 4 and GROUP[ i] =j {
*
IF GROUP j ] \ = N THEN print the teams \n the group , & go to next line . }

HUE
Generate between 1 & 12
set J to i 1 — , store in N
ELSE lFi <8 andOROUP[ i] = j{
print the teams in the group, & go to next line .

END IF
set j to / - 1 ELSE IF i <« 12 and GROU?[i] = j {
print the teams in the gro , & g0
to next line .
UNTIE j «• 1
assign the number genrated to GROU END FOR.
) ^
END FOR
END FOR
Figut* 3 Figure 4
4
£)TRU /RPI /COSTA/0795/P2/VIQCK 2024 Page 2 ol

1 •• i %

for more past questions and solutions download kawlo kawlo app or visit http://www.gcerevision.com
pic p3eudocod
mm
^ ^ A
GROUP
_
for more past questions and solutions download kawlo kawlo app or visit http://www.gcerevision.com
rHi mrjJ wjn licit Vnu In I
*
<r #
nil
“ imi tit ? jj tiii|>
' llsfui * i A tumip|t> display < d group A h below

1. Egypt
2. Senegal
3. Guinea
4. IvoryCoast
ii . Sorting ( he Teams .
You may need the pseudocode below to sort the lentil alphabetically
* •
Mi

Declare i, j( intcgcrs), temp (string)


--
FOR I n to 1 do
FOR j * I to i do

)
IF Array ( j ) < Array|J 11 then
<

om
Swap Arraydl and Array|| I|
END IF
-
END FOR
END FOR

.c
Figure 5

Program Implementation

n
Implement a program for the ACTIVITLCA that mnU up y* » i * f rul* in thy ptujrcf \ ty /tn « werinj{ the quotum below

io
1 .
a. tu « pmcrmttnutn£ Gstr /tvmnenl ( lME ) mul IVogmiNiiiing l miguiigc yon arc going to line ,
is . ( 2 marks )
) ;
b. Give two advantages of using the 11 1 in l ( n ) above over n normal text editor ,
* ( 1 marks )
c. What specific name is given to the data structure "QUALIFIED" in figure I above? ( 1 mark )
ev
2 . Write a programming Language procedure QiutUflnlTeiimN( /f / 7 size ) that take* tlic array •QUAUf IISD *
as argument, to store the qualified countries in the order specified in figure I ^ ( 2 rnarks )
3 Write
. a Programming Language Procedure Dlsplay ( nrray , si /.c ) that takes as argument the array
r

“QUALIFIED” and displays the teams that qualified ns shown in figure I . ( 2 marks )
ce


4 . Write a Programming Language Procedure
generates unique random numbers and
Ran
store
<
them
lomize
in
( m
GROUP
/ K size
by
) that take
implementing
as
the ^
argument an
algorithm
array
in
GROUP
figure 3 ,
’,

( 5 marks )
(g

5. Write a Programming language Procedure Flxturcs ( array I , nrray 2 , size ) that takes as argument two arrays
“ QUALIFIED ” and “ GROUP ” and displays the THREE Groups by implementing the algorithm in figure 4 .
Going back to read the description of how fixtures arc generated could be helpful ( 5 marks )
LO

Language Procedure Sort ( arruy , size ) that takes the array QUALIFIED” as argument
6. Write a Programming
and implements the algorithm in figure 5 to sort it in ascending Order
. ( 5 marks;
does the following in oidei to run your program and display various outputs .
7 Implement a main function that
i. Declare two arrays “QUALIFIED” and “ GROUP ” as the global variables ( i mark )
W

call Display.
ii . Call the procedure QuaJifiedTeams first then .
( 1 mark )
by Fixtures
iii . Now call the procedures Randomize and followed
( 1 mark)
DisplayO -
KA

by
iv. Finally call the procedures Sort() followed
( 1 mark )

v Make sure there arc no errors, save your program as AFCON 2023 compile and run the program .
you have obtained . ( 2 marks )
Attach a printout of your code and the output
implementing your program
HINTS: The following may be useful in
To print a string in the format > “ I . Computer
printf (“%d . %s”, i, array[i])
strcpy(str[, str2)
__ To copy str2 to strl
strcmp(strl , str2 )
To compare strl and str2
To input a string
gets(strl ), scanf(“%s”,
&arrayf index ) )
To display a string to the console.
puts(strl ), printf(“%s”,
arrayfindex])
Contains string library functions/procedures
stringJi
TURN OVKK
truvmnmm/rvMOCK 2024 b e ' produced I " ""”" <he permission of the authon. 3
This document !$ the property of the TRV and
the ciornte of M n u m' '‘

for more past questions and solutions download kawlo kawlo app or visit http://www.gcerevision.com
for more past questions and solutions download kawlo
, kawlo app or visit
number ,
lo m c r«i& „
«rehttp://www.gcerevision.com
for t ch
* *
rand( ttmefNlflJ .) )
*
pi Hbffrv ftfl^M^BggggSarBttHH
flirt

C nl«ini
i
t
time.h
.^ .
Mnnu' j "" ,2
T'i V"
*
,
sir I s!r 2
ra»d( )% 1 2 + 1
l ri ciwJcniMdomntmilKr ^^ w^1 1 Pi
* ~

(20 mark
*)
SECTION B: i

V. "A relational database


to
impleme nting an online ordering system tin I i
A takeaway restaurant is
store details about the dishes, cuslomers
and order * , « h four tahlcs
{ he
, i tables used
place and edit orders
The restaurant can view order details . Custome rs arc able to
in the database arc shown below .
Customer
CmtowsrOrdT
Ord+rrfD Customerlt) OrderDate
CustomertO Flrstname t astiiame AddfABB l«l#phone
ORD 1 31 15/05,2023
0 / 7 / 7 / 74 /

)
31 H&nry Kudu utroet 05
15/052023

om
ORD 2 32
32 Ksty Cham Com Ave
072003 / 47 ORD 3 33 16/012024
33 James Nathan mile 2
675006747

.c
Orrlerltem Oinfi
Court Price
OfderlD* DithID * Quantity OUhfD* Uotctlptlon *

n
ORD 1 DifhOi 7 #urt r 3500
DlthOt Papptrtoup
*
ORD 1 Dl? h05 3

io
DI» MJ2 M
**f> 7500

Ol h04 3
is 7000
ORD 1 * Di » ft03 lc# Cf
* #m
1 2000
ev
DlshOO Dlfb04 rri d Ric # Grinfc
PRO 1 *
Dish02 2 Main 4500
ORD 2 Olsh05
ORD 2 Dlth04 2
r

Dl h05 Omcfctn Main 5000


*
ce

ORD 3 Dlsh03 7
Dl t\ 07 Cn y cracker, Starter 2500
ORD 3 DHh04 5 * ^
(g

ij Draw an Entity Relationship diagram v» show the relationships in the database. ( 3 marks )
ii) Write SQL code to create a database for the restaurant called “RESTAURANT” ( 1 mark)
iii) Create each of the tables above using SQL and copy iV codes in your answer sheet ( 4 marks)
LO

ivj Populate each table with the data provided using SQI „ Copy iv* codt . ( 4 marks )
v ) Design a query to display the number of orders that the customer wuv% oo*«mer ID 31 made in May 2023
(3 marks)
Vi) The manager wants to increase the price of main dishes by 1000 frs. Write the SQL star merit that will
W

*
implement this. (3 marks)
vii) Save your database as “RESTO” and print your outputs. markS )
KA

END

XJTK (UKFI/I OSTA/OnWVMW


Page 4 of 4

for more past questions and solutions download kawlo kawlo app or visit http://www.gcerevision.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy