Computer Science 1 2025 Smuyfjlxrc
Computer Science 1 2025 Smuyfjlxrc
COMPUTER SCIENCE
INSTRUCTIONS TO CANDIDATES:
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
TRU/RPI/0795/2025
1. (a) (i) Explain the roles of the Control Unit and the Arithmetic and Logic Unit (ALU) in a CPU (2 marks)
(ii) How does the word size of a CPU affect its performance? (2 marks)
(iii) Describe the steps involved in the machine cycle. (2 marks)
(b) (i) How much memory can a 32-bit address bus address? (2 marks)
(ii) How many bits are needed to address 512 MB of memory? (2 marks)
(iii) Distinguish between direct addressing and indirect addressing. (2 marks)
(c) (i) Explain the concept of virtual memory and how it allows a computer to run larger programs (3 marks)
than its physical RAM would normally allow.
(ii) State and explain two factors that can affect the computer performance. (2 marks)
2. (a) (i) Represent the decimal number -45 in 8-bit two’s complement form. (2 marks)
(ii) Perform the binary addition of 1101 and 1011. (2 marks)
(b) (i) Design a truth table for a logic circuit that outputs 1 when the number of 1s in inputs A, B, (2 marks)
C is even.
(ii) Derive the Boolean expression for the output X of the circuit. (2 marks)
(iii) Draw the logic circuit using XOR gates. (2 marks)
(c) (i) Compare sequential access and direct access storage methods, giving an example of each. (3 marks)
(ii) Explain the difference between half-adder and full-adder circuits. Provide their truth tables (4 marks)
and expressions of their outputs.
1 of 2
TRU/RPI/0795/2025
5. (a) (i) Distinguish between a Local Area Network (LAN) and a Wide Area Network (WAN) (2 marks)
(ii) Describe the star topology and explain why it is easy to manage and troubleshoot. (2 marks)
(b) (i) 1 of 2
A company has offices in three cities. Suggest a suitable WAN topology for connecting (3 marks)
these offices.
(ii) Explain the role of a router in such a network. (2 marks)
(iii) State and give the role of two other network equipments that can be used in that network. (4 marks)
(c) (i) Compare synchronous and asynchronous data transmission. (2 marks)
(ii) Explain the purpose of a firewall in network security. (2 marks)
7. (a) (i) Describe the stages of the System Development Life Cycle (SDLC). (4 marks)
(ii) What is the purpose of a feasibility study in system development? (2 marks)
(b) (i) Describe two methods a systems analyst can use to gather information about an existing (4 marks)
system.
(ii) Explain the parallel changeover method in system implementation. (2 marks)
(c) (i) Distinguish between black box testing and white box testing. (3 marks)
(ii) Explain the importance of user documentation in system development. (2 marks)
8. (a) (i) Design test data for a program that checks if a person is eligible to vote (age >= 18). (3 marks)
(ii) Why might a software developer provide only the object code to the user? (2 marks)
(b) (i) Identify a logic error in the following pseudocode: (2 marks)
IF age > 18 THEN OUTPUT "You can vote" ELSE OUTPUT "You cannot vote"
(c) (i) Explain the concept of encapsulation in object-oriented programming. (2 marks)
(ii) Write a pseudocode algorithm to calculate the sum of the first N natural (4 marks)
(d) Consider the following algorithm written in pseudocode:
FUNCTION MysteryAlgorithm(A, n):
sum ← 0
FOR i ← 1 TO n DO
IF A[i] > 0 THEN
sum ← sum + A[i]
ELSE
sum ← sum - A[i]
END IF
END FOR
RETURN sum
END FUNCTION
Dry run the algorithm for the array A = [3, -2, 5, -1, 4] and n = 5. Complete the trace table (4 marks)
below, showing the values of i, A[i], and sum at each step.
Iteration Value of i Value of A[i] Value of sum
2 of 2
TRU/RPI/0795/2025