CompSci U1 P2 2024
CompSci U1 P2 2024
UNIT 1- Paper 02
2 hours 30 minutes
447
4. If you need to rewrite any answer and there is not enough space to do so on the
original page, you must use the extra lined page(s) provided at the back of this
booklet. Remember to draw a line through your original answer.
A000 5. If you use the extra page(s), you MUST write the question number clearly in
thebox provided at the top of the extra page(s) and, where relevant, include
the question part beside the answer.
COMPUTER ARCHITECTURE
1. (a)
State the function of EACH of the following registers that are commonly found in
microprocessors.
(i) Instruction register (IR)
[1 mark)
(ii) Memory address register (MAR)
[1 mark]
(iii) Memory data register (MDR)
[lmark]
GE
02115020/MJ/CAPE 2024 GO ON TO THE NEXT PA
AREA terms of access method and access
(b) () Explain how a hard disk differs from RAM in
speed.
THIS
IN
WRITE
NOT
DO
AKEAn.
447
[3 marks]
portability.
INTHS (ii) Explain how RAM differs from a flash drive in terms of volatility and
THISAREADONOERITE
A000
[3 marks]
LN
KRITE
DONOI
L 02 11 5 0 2 0 0 S
-6
'instruction format'.
(c) (i) Describe the term
[2 marks]
modes.
(i) Describe the following addressing
447
One-address
[2 marks]
Two-address
A000
(2 marks]
Total15 marks
02115020/MJ/CAPE 2024
GO ON TO THE NEXT PAGE
L -7
1 1 1
Design and draw the circuit digram represented by the truth table above, using only primary
logic gates.
04
|4 marks|
02
- 8
In a security system, four sensors are used to transmit data to a single line for alarm
(b)
second.
notification, Each sensor transmits data for one
described above
(i) Explain howa multiplexer can be used for the purpose
447
(3 marks]
(ii) Draw a clearly labelled block diagram of a 4 to 1 multiplexer that can be used in
the security system.
A000
(3marks]
02115020/MJ/CAPE 2024
GO ON TO THE NEXT PAGE
-9
(c) (i) State the smallest and largest integers that can be stored in eight bits when
signed
magnitude representation is used.
Smallest integer
Largest integer
[2 marks]
(ii) Calculate the 8-bit two's complement representation of-87.
[3 marks]
Total 15 marks
SECTION B THE
WR
DO
PROBLEM-SOLVING WITH COMPUTERS
to acowte
3. called Tech World sells used laptops and tablets. Tech World wishes
(a) Acompany laptops and tablets in stock and handle
software to track purchases, the quantities of
the serviceS of a software company
customer information, The company has contracted
that writes software applications.
generally follow when creating
Describe any TWO stages that the software company would
the software for Tech World.
47
ARE
THI
IN
HRI
NOT
DO
[4 marks]
ARE
THI
IN
[2marks] WRI
NOT
DO
02 0 1 0
- 1| -
(ii) A Certain cellular company provides the following rates for purchasing cellphone
data.
Draw aflowchart that reads an integer value representing the number of gigabytes
used for voice calls and that calculates and prints the cost of calls.
19 marks|
Total15 marks
GO ON TO THE NEXT PAGE
02115020/MJ/CAPE 2024
J
- 12
[2 marks]
(ii) Bottom up
447
[2 marks]
(b) List the THREE types of control constructs in structured
programming.
[3 marks]
A000
J
- 13
(c)
Consider the following
IF
algorithm.
(num > 1)
IF (num==3)
ELSE
PRINT "RED"
PRINT "BLUE"
ENDIF
ENDIF
PRINT "GREEN"
Write the output of the
algorithm when
(i) num == 1
(ii) num = 2
(iii) num =3
|3marks]
02115020/MJ/CAPE 2024
01 3
- 14 -
Iteration Print
447
2 ARB
3
THS
4
HRTE
[5 marks]
NOT
Total 15 marks
DO
A000
REA
INH
NOTW
DO
NOT
O
02115020/MJ/CAPE 2024
GO ON TO THE NEXT PAGE
L S0 2 0 1 4
L - 15
SECTION C
PROGRAMMING
[1 mark]
(ii) State how EACH of the following can be used to create maintainable code.
Indentation
Comments
[2 marks]
Line 1. int a, b:
Line 2. for (a = 1;a <= 5: a)
Line 3. for (b =1:b<a: b=b+ 1)
Line 4. printf ("%s", b);
Line S. printf (n):
errors occur and
ldentify the THREE erors in the segment. State the lines in which the
rewrite the lines corectly.
Line
147
Line
Line
[6 marks
(C) Write C code to performthe following fileoperations.
(i) Read
[2 marks]
A000
(iü) Append
[2 marks]
(iii) Close
(2 marks
Total 15 marks
GOON TO THE NEXT PAGE
02115020/MJ/CAPE 2024
- 17
(a)
6. Differentiate between 'obiject oriented' and <functional'
programming languages.
[2 marks]
[3marks|
programming languages.
TWOappropriate examples, explain the need for different
(c) Using
(J marka|
02115020/MJ/CAPE 2024 J
- 18 -
(arr) and
accepts two parameters, an integer array print .
AREA
(d) Cfunction, maximum, that
Write a function should
indicating the size of the array. The
an integer variable (size) return a value. THMS
maximum value in the array and should not
WN
NOI
DO
447
[7 marks]
Total 15 marks
WR
NO
no
END OFTEST
IE VOIFINISH BEFORE TIME IS CALLED, CHECK YOUR
WORK ON THIS TEST.