Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

HOLY INFANT HIGH SCHOOL YAOUNDE

MOCK CAMEROON GENERAL CERTIFICATE OF EDUCATION EXAMINATION

COMPUTER SCIENCE 2
0795

MARCH 2023 ADVANCED LEVEL


Subject Title Computer Science
Paper No. 2
Subject Code No. 0795

Two and a half Hours

Answer any SIX questions.

All questions carry 17 marks each. For your guidance, the approximate mark for each part
of a question is indicated in brackets.
You are reminded of the necessity for good English and orderly presentation in your
answers.
In calculations, you are advised to show all the steps in your working, giving your answer
at each stage.

Turn Over
March 2023/0795/2/CSc
©2023HIHS

Page 1 of 5
1. A normalized floating-point representation uses an 8-bit mantissa and a 4-bit exponent, both held using
twos complement format.
(a) By completing the boxes show how the following denary values would be held.
(i) 41.25 Mantissa Exponent

(3 marks)
(ii) -6.75
Mantissa Exponent
(3 marks)
(iii) 0.125
Mantissa Exponent
(3 marks)
(b) Subtract (29.A)16 from (4F.B)16. Use 2’s complement arithmetic. (3 marks)
(c) Define the following terms as far as process state diagram is concern.
i) Context switching (1 mark)
ii) Overhead (1 mark)
iii) Dispatcher (1 mark)
(d) A CPU scheduling algorithm determines an order for the execution of its scheduled processes.
Given n processes to be scheduled on one processor, how many different schedules are possible?
Give your answer as a formula in terms of n. (2 marks)

2. (a) One function of an operating system is memory management.


i) Explain two activities of the operating system in relationship to memory management. (2 marks)
ii) State three circumstances under which CPU scheduling decisions may take place. (3 marks)
iii) List and define three different metrics by which we might evaluate a scheduler. (3 marks)

(b) Operating systems make use of device drivers.


i) Define what is meant by the term ‘device driver’. (2 marks)
ii) Give two examples of device drivers that a home user will need. (1 mark)

(c) Explain briefly the following computing terms, giving an example of each.
i) Deadlock,
ii) Polling,
iii) Spooling. (6 marks)

3. (a) The diagram below shows a logic circuit.


A G
B

C H K
D

E
F
Page 2 of 5
Complete the truth table for the inputs that have been given below (3 marks)
Inputs
A B C D E F G H K
0 0 1 1 0 0
0 1 1 1 0 1
1 0 1 1 1 0
1 1 1 1 1 1

(b) An interior light in a two-door car is controlled by two switches that the driver can turn on or off and
two sensors, one per door. The switches are named A and B. The door sensors are named C and D.
The interior light is named L. If a door is open the output of its sensor is on. If a door is closed the
output of its sensor is off.
• If both switches A and B are off then the light L is always off.
• If switch A is on the light L is always on.
• If switch B is on and switch A is off then:
o the light L turns on if one or more of the car doors is opened
o the light L turns off if both of the doors are closed.
i) Using only AND, OR and NOT gates draw a logic circuit for this system. (6 marks)
ii) Write a Boolean expression to represent the logic of the interior light system. (2 marks)
(c) A computer system has a clock speed of 3 GHz, a 32 bits data bus and a 24 bits address bus. What
would be the precise effect of:
(i) increasing the clock speed to 6 GHz? (2 marks)
(ii) increasing the size of the data bus to 64 bits? (2 marks)
(iii) increasing the width of the address bus to 40 bits? (2 marks)

4. (a) Describe TWO methods that the Systems Analyst could use in order to collect information about the current
system being used in the school. For each method, give a suitable example to illustrate your answer. (6 marks)
(b) During the process of developing a new system, changeover is one of the most important aspects in
deploying the new system.
i) Describe how pilot parallel changeover is done in system development. (2 marks)
ii) State one Advantage and one Disadvantage of this changeover method. (2 marks)
iii) Explain given an example of information contained in User and Technical Documentation.
(4 marks)
(c) Describe the following software testing techniques;
i) Blackbox testing. (1 mark)
ii) Whitebox testing. (2 marks)
5. (a) Most businesses utilize information systems, each with functionality that assists in managing a
particular unit or organization.
i) Differentiate between Database and Information system. (2 marks)
ii) Explain two types of information system. (4 marks)
(b) Explain the difference between incremental prototyping and evolutionary prototyping. (2 marks)
(c) Explain the waterfall model of software life cycle. State two of its main limitations. (4 marks)

Page 3 of 5
(d) A Local Education Authority (LEA) wants to promote healthy eating amongst the pupils in its
schools.
• The cafeterias in the schools offer main meals served on plates, fruits and pre-packed sandwiches,
snacks and drinks.
• When arriving at a checkout pupils must have a range of foods to provide a balance diet.
• Any food the pupil bought earlier in the day should be considered when deciding whether the food
chosen is acceptable.
Currently, the pupils keep a diary of the food they eat each, which gets checked on a weekly basis. This
is very time-consuming and the LEA decides that a computer system is to be installed in the
cafeterias to aid the checking of pupils’ choices.
i) The new system has been built. Briefly describe the stages that still have to be carried out before
the new system becomes “live”. (3 marks)
ii) Describe two ways in which the system might be evaluated after installation and testing has been
completed. (2 marks)

6. (a) With reference to object oriented programming, explain the following terms.
i) Encapsulation (2 marks)
ii) Polymorphism (2 marks)
iii) Inheritance (2 marks)
iv) Class (2 marks)
(b) Distinguish between Syntax and Semantic errors as used in programming. (1 mark)
th
The letters F0 . F1 . F2 .…. FN, where N ≥ 0, are used to identify the N term of the sequence of
Fibonacci numbers that start as follows: 0 . 1 . 1 . 2 . 3 . 5 . 8 . 13 ……
With the exception of the leading 0 and 1 (the zeroth term and 1st terms) in the sequence is the sum of
the two preceding terms.
i) State the value of the 8th term in the sequence. (1 mark)
The following subroutine, Fibo(N), generates the Nth term in the sequence.

Integer FUNCTION Fibo(Integer: N)


Start
IF (N = 0 OR N = 1) THEN
Return N
ELSE
Return (Fibo(N – 1) + Fibo(N – 2)
ENDIF
Stop

ii) Evaluate Fibo(4) using a recursion tree, the difference levels of recursion. (2 marks)
iii) Construct a non-recursive tree, showing the different levels of recursion. (2 marks)
iv) Construct an algorithm that will output the first N terms of the sequence including the Nth term.
You should use Fibo(), the method defined above. (2 marks)
(c) Recursive programs written in high level languages require the use of particular structures to support
their execution. A stack is usually employed in the running of a recursive algorithm.
State three components of a stack frame. (1 mark)

Page 4 of 5
7. (a) What is a data structure? (1 mark)
(b) What do you understand by the terms height of a binary tree and a full binary tree? (2 marks)
(c) A binary search tree is an example of a data structure.
i) Insert the following towns in a binary search tree in the order they are given. Bamenda, Maroua,
Bafoussam, Ngaoundere, Ebolowa, Bertoua, Yaounde, Douala, Garoua, and Buea. (3 marks)
ii ) State the result of the Inorder tranversal of the above tree. (1 mark)
(d) Briefly describe the following abstract data structure, listing the basic operations and stating an
application of each type.
i) Stacks (3 marks)
ii) Queues (3 marks)
(e) Write an algorithm that calculates and displays the average mark for a student, given the total
number of subjects done by the student and subject marks. Use the following variables:
NumberOfSubjects, Sum, Count, SubjectMark and Average. (4 marks)

8. (a) Why are databases very important today? (2 marks)


(b) Define the following terms as far as databases are concerned.
i) Foreign key
ii) Entity (2 marks)
(c) A school database has two tables TEACHER and SUBJECT, with primary keys Teacher_ID and
Subject_Code repectively. Study the tables below and answer the questions that follow.
TEACHER: table
Teacher_ID* Teacher_Name DOB Phone Subject_Code

SUBJECT: table
Subject_Code Title Hours_per_Week

i) Define the term referential integrity as used in databases. How does it affect the insertion of records
in a database table? Explain your answer using this database. (3 marks)
ii) Present exactly ONE row of sample data for the database entity TEACHER, and exactly TWO rows
for the entity SUBJECT. (4 marks)
iii) The relationship “Teacher” exists between the TEACHER table and SUBJECT table. What is the
cardinality of this relationship? Explain what this cardinality means (2 marks)
iv) Draw an entity relationship diagram that shows how these tables are related. Primary keys and
cardinalities should be clearly shown. (4 marks)

Page 5 of 5

You might also like