Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

NAL MOCK 2024, 795 COMPUTER SCIENCE PAPER 3

NAL Bilingual Academic Complex REPUBLIQUE DU CAMEROUN


Bonamoussadi.Bangue REPUBLIC OF CAMEROON
POBOX: 3712 Douala Paix – Travail - Patrie
Tél. :242 663 521 Peace - Work- Fatherland
www.cosbinal.cm AcademicYear 2023/2024

GENERAL CERTIFICATE OF EDUCATION MOCK EXAMINATION


ADVANCE LEVEL
SUBJECT TITLE 795- COMPUTER SCIENCE MARCH 2024

PAPER NUMBER 3

Time Allowed: (3H)

INSTRUCTIONS TO CANDIDATES:

Answer ALL questions.

1
MOCK/NAL/0795/3/2024/ Turn Over
NAL MOCK 2024, 795 COMPUTER SCIENCE PAPER 3
Part 1

Task 1: Database for Furniture Company 25 marks

A company sells furniture to customers of its store. The store does not keep furniture in stock.
Instead, a customer places an order at the store and the company then orders the furniture
required from its suppliers. When the ordered furniture arrives at the store a member of staff
telephones or emails the customer to inform him/her that it is ready for collection.

Customers often order more than one type of furniture on the same order, for example a sofa
and two chairs.

Details of the furniture, customer and orders are to be stored in a relational database using the
following relations:

Fumiture(FurniturelD. FurnitureNamc, Category, Price, SupplierName)

CustomerOrder(OrderlD. CustomerlD, Date)

CustomerOrderLine(OrderlD. FurniturelD. Quantity)

Customer(CustomerlD. CustomerName, EmailAddress, TelephoneNumb)

The attribute for these relatiions and others used eventually , are detailed as fellows

Descriptions Data type File size Remark


FurniturelD Number 6 Must be present
FurnitureNamc Varchar 15
Category Varchar 15 Must be present
Price Number Must be present
SupplierName Varchar 10
OrderlD Number Must be present
Date Date
Quantity Number
CustomerlD Varchar 6 Must be present
CustomerName Varchar 15
EmailAddress Varchar 20
TelephoneNumb number
validation Varchar
Develop a database for the furniture company by performing the task below

i) Give an E-R daigram that shows the degree of the any three relationship that exist
between the above entities 3 marks

2
MOCK/NAL/0795/3/2024/ Turn Over
NAL MOCK 2024, 795 COMPUTER SCIENCE PAPER 3
ii) Using SQL statement do the following using your favorite DBMS
1. Create a database call sells 2 mark
2. Create the four table above. Write down the SQL statements 8 marks
3. Identify the primary, foreign and composite keys if any. Justify your answer. 6
marks
4. Write down the SQL statement to insert the value “389, T199, 02/02/2024” in the
CustomerOrder table. 2 marks
5. Write down the SQL statement to modify the value “OderID “389” to “550”, in
the CustomerOrder table. 2 marks
6. In the sells, create all the relationship given above 4 marks

Part 2: programming 25 marks

3) a) Explain how the linear search algorithm works given an array of size N. (3 marks)
b) consider the psuedocode below and answer the questions that fellows
interger fact(int i)
Begin
if i=1 ; Then
return 1 ;
Else
return(i*fact(i-1)) ;
End
i) Write iterative version of the function factorial show above and implement it using either c or
Pascal. (10 marks)
ii) Using function write a c or Pascal that prompt the user to enter a an integer a print a
triangle using stars. (10 marks)
iii)
iv) Justify why programmers prefer the iterative function over the recursive function show in the
psuedocode above. (2 marks)

3
MOCK/NAL/0795/3/2024/ Turn Over

You might also like