NW Al CSC P3 2024
NW Al CSC P3 2024
— 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
.
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
•
• 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 .
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
• 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
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
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
)
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
)
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
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
for more past questions and solutions download kawlo kawlo app or visit http://www.gcerevision.com