General Instructions
Section I: 20 marks
Attempt Questions 1–10
Section II: 60 marks
Attempt Questions 11–16
Use the answer sheet provided. Choose the alternative A, B, C or D that best completes the statement or answers the question.
1 Which programming construct is demonstrated in the following pseudocode?
2 In object-oriented programming, encapsulation refers to
3 Which SQL statement correctly creates a foreign key relationship?
4 The primary security benefit of HTTPS is
5 In a mechatronic system, the role of a sensor is to
6 Which development methodology is characterised by sequential phases that must be completed before moving to the next?
7 SQL injection attacks can be prevented by
8 In Continuous Integration (CI), code changes are
9 A closed-loop control system differs from an open-loop system because it
10 Linear regression in machine learning is used to
Question 11
A school library is developing a digital system to manage book loans.
(a) Draw a context diagram for the Library Management System showing at least FOUR external entities and their data flows with the system. (5 marks)
(b) Explain the purpose of system boundaries in context diagrams. (3 marks)
Question 12
Consider this Python code for a smart home system:
(a) Identify and explain TWO object-oriented programming concepts demonstrated in this code. (6 marks)
(b) Write Python code to create a Fan class that inherits from Device and includes a set_speed(speed) method that validates speed is between 1 and 5. (4 marks)
Question 13
A university wants to create a database to manage student enrollments.
(a) Design an Entity-Relationship Diagram (ERD) showing the relationships between Student, Course, and Enrollment entities. Include appropriate attributes and relationship cardinalities. (6 marks)
(b) Write SQL CREATE TABLE statements for the Student and Enrollment tables with appropriate primary keys, foreign keys, and constraints. (6 marks)
Question 14
A company is developing a web-based student portal that handles sensitive academic records.
(a) Explain the difference between authentication and authorisation in the context of this portal. Provide ONE example of each. (6 marks)
(b) Identify and explain TWO security vulnerabilities that could affect this web portal and describe how each can be prevented. (6 marks)
(c) Justify why HTTPS should be used for this portal rather than HTTP. (3 marks)
Question 15
A software development team is implementing a Continuous Integration/Continuous Deployment (CI/CD) pipeline for their school management application.
(a) Describe FOUR stages that should be included in their CI/CD pipeline and explain the purpose of each stage. (8 marks)
(b) Compare the benefits of automated testing versus manual testing in this context. (2 marks)
Question 16
An agricultural company is developing an automated greenhouse monitoring system that controls temperature, humidity, and watering based on sensor readings.
(a) Explain why this system should use closed-loop control rather than open-loop control. Include the role of feedback in your explanation. (5 marks)
(b) Identify THREE types of sensors that would be needed for this system and explain what each sensor would monitor. (6 marks)
(c) The company wants to use machine learning to predict optimal watering schedules based on historical data. Explain how linear regression could be applied to this problem, including what the input and output variables might be. (4 marks)
End of examination
Mark your answers clearly with a cross (X) in the appropriate box
| Question | A | B | C | D |
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 |
| Question | A | B | C | D |
|---|---|---|---|---|
| 6 | ||||
| 7 | ||||
| 8 | ||||
| 9 | ||||
| 10 |