2025 ASRJC H2 Computing Prelim Theory Paper (Solutions)
Uploaded by Randomguy123456788 · 28 September 2025
Preview
Text from the first pagesQuestion 1 [8 marks] Below shows a pseudocode of insertion sort with blanks. PROCEDURE InsertionSort(A : ARRAY[0 : N - 1] OF INTEGER) // using 0-indexing FOR i ← ……(1)…… TO ……(2)…… temp ← A[i] j ← ……(3)…… WHILE j >= 0 AND temp < ……(4)…… ……(5)…… ← A[j] j ← ……(6)…… ENDWHILE ……(7)…… ← temp NEXT i ENDPROCEDURE Write your answer for each blank (1) through (7) clearly. [3] State the worst-case time complexity of insertion sort and briefly explain what that implies. [2] Insertion sort is effective for small arrays due to its simplicity and low overhead. However, for larger arrays, more efficient algorithms such as merge sort are preferred. Describe how merge sort works and state its time complexity. [3] Answers: (a) (1) 1, (2) N – 1, (3) i – 1, (4) A[j], (5) A[j + 1], (6) j – 1, (7) A[j + 1] (b) Worst-case time complexity: O(n2) For large datasets, the number of operations required for insertion sort grows quadratically with input size. (c) Merge sort is a divide-and-conquer algorithm that sorts an array by recursively breaking it down and then combining them in sorted order. - Divide the array in half repeatedly until each subarray contains only one element. - Combine adjacent subarrays back together in sorted order. Continue this process until the entire sorted array is constructed. Time complexity: O(n log n) Question 2 [15 marks] (a) State what is meant by data integrity. [1] Sonars Service Centre handles repairs of their proprietary Sonars audio products. When customers bring equipment for repair, technicians would need to enter the product serial number into the system. Each serial number consists of 10 digits, where the last digit is a check digit calculated using this algorithm: 1. In the first pass, multiply each of the first 9 digits of the serial number by weights: 9, 8, 7, 6, 5, 4, 3, 2, 1 respectively (e.g. position 1 gets weight 9). Sum these products to obtain subtotal. 2. In the second pass, using the same 9 digits of the serial number, multiply each digit by the sum of its own value and its position number (e.g. if the first digit is 5, we get a product of 5 x (5 + 1) = 30 for that digit). Sum these products to obtain another subtotal. 3. Add the two subtotals from the two passes to obtain a combined total.
4. Divide the combined total by 13 to obtain the remainder. Subtract the remainder from 13 to derive the check digit. (b) (i) It is given that 284736197X is a valid serial number, where X represents the check digit. Calculate the value of X, showing your workings. [3] (ii) Briefly explain why check digit alone is insufficient to ensure data integrity. [1] (iii) Describe two data verification methods that can be used when manually entering serial numbers into the system. [2] When a Sonars amplifier system arrives for diagnosis, the technician checks for these symptoms: ● whether the power LED is OFF ● whether the audio output is abnormal ● whether the amplifier is overheating The following describes the actions the technician would take: If the power LED is off, check the power supply and fuse only regardless of other symptoms. If the power LED is on and the audio output is abnormal (but not overheating), test the input connections. If the amplifier is overheating, clean the ventilation system and fans. If the audio is abnormal and the amplifier is overheating, also check the output transistors, as they may be faulty. If none of the 3 symptoms are present, perform exterior cleaning. It is desired to draw a decision table for the above information. (c)(i) Explain what a decision table is. [2] (ii) Create a complete decision table based on the description above. [4] (iii) Show a simplified decision table without redundancies. [2] Answers: (a) Data integrity refers to the accuracy, consistency and reliability of data throughout its entire lifecycle (creation, storage, transmission). (b)(i) For the first pass, subtotal = 2x9 + 8x8 + 4x7 + 7x6 + 3x5 + 6x4 + 1x3 + 9x2 + 7x1 = 219 For the second pass, subtotal = 2x(2+1) + 8x(8+2) + 4x(4+3) + 7x(7+4) + 3x(3+5) + 6x(6+6) + 1x(1+7) + 9x(9+8) + 7x(7+9) = 560 Combined total = 219 + 560 = 779 Remainder = 779 MOD 13 = 12 Check digit, X = 13 – 12 = 1 (ii) Check digit cannot catch all possible data entry errors, such as multiple errors that might cancel each other out. While it verifies mathematical correctness based on the algorithm, it cannot detect whether the serial number exists for an actual product. (iii) Double entry: requiring user to enter the same serial number twice in separate input fields. The system compares both entries to ensure they are identical before accepting the data. Visual confirmation: displaying a message box showing the entered number and prompting the user to confirm that it matches the serial number on the physical device. (c)(i) A decision table is a tabular method to document decision-making logic. It systematically shows all possible combinations of conditions, with each of the corresponding actions to take.
(ii) Decision table with 8 rules: Rule 1 2 3 4 5 6 7 8 Conditions Power LED is OFF Y Y Y Y N N N N Audio output is abnormal Y Y N N Y Y N N Amplifier is overheating Y N Y N Y N Y N Actions Check power supply and fuse X X X X Test input connections X Clean ventilation and fans X X Check output transistors X Perform exterior cleaning X (iii) Simplified decision table: Conditions Power LED is OFF Y N N N N Audio output is abnormal --- Y Y N N Amplifier is overheating --- Y N Y N Actions Check power supply and fuse X Test input connections X Clean ventilation and fans X X Check output transistors X Perform exterior cleaning X Question 3 [12 marks] Harley Thorman Corporation is developing an inventory management system for its electronic products using Object-Oriented Programming (OOP). The main types of electronic devices that the corporation sells are display devices, audio devices and computing devices. Display devices include televisions, computer monitors and screen projectors. Audio devices include speaker systems and headphones. Computing devices include desktops, laptops and tablets. (a) Draw a class diagram for this system showing classes and their inheritance relationships. Do not include any attributes or methods in the diagram. [3] (b) Explain why inheritance is an important feature in OOP. [1]
(c) Suggest which class each of the following attributes should be placed in, explaining your choice: ● CPU model ● product serial number. [3] (d) Suggest a possible private method that one might include in the OOP system, explaining why keeping it private would be reasonable. [2] There are different types of TV display technologies, each with distinct features. LCD TVs use liquid crystal displays with backlighting, while LED TVs use LED backlighting for better energy efficiency. OLED TVs use organic light-emitting diodes that allow pixels to turn completely off, providing superior contrast ratios. QLED TVs use quantum dot technology to enhance brightness and colour accuracy. What distinguishes them is the panel technology type, which results in differences in display characteristics such as contrast ratio, peak brightness and colour gamut coverage. (e) Suggest how the OOP system should be updated to accommodate these different TV display technologies, justifying the approach chosen. [2] (f) Explain what is meant by polymorphism in OOP. [1] Answers: (a) Class diagram: (b) Inheritance enables developers to reuse code efficiently, as common attributes and methods can be defined in a parent class, and all subclasses would inherit these functionalities. It eliminates the need to duplicate code across multiple classes. Updates made to the parent class automatically propagate to all
Content continues in the PDF. Download PDF
Related notes
- NYJC 2026 Prelim P2Exam Papers · 2026
- NYJC 2026 Prelim P1Exam Papers · 2026
- DHS 2026 Y6 H2 Computing Prelim Paper 2_finalExam Papers · 2026
- ACJC 2026 JC2 Computing Prelim Paper 2 (Practical)Exam Papers · 2026
- 2026_NJC Prelim_Computing_P2.pdfExam Papers · 2026
- 2026_JPJC_Computing_Prelim_P2_finalExam Papers · 2026
- 2026_JPJC_Computing_Prelim_P1_markschemeExam Papers · 2026
- 2026_JPJC_Computing_Prelim_P1_finalExam Papers · 2026
- 2026 ACJC Prelim Computing Paper 2Exam Papers · 2026
- 2024 ACJC Computing PromoExam Papers · 2024
- 2023 ACJC Promo QPExam Papers · 2023
- 2022 ACJC Computing Promo Paper 2Exam Papers · 2022
- See all H2 Computing notes

