NJC 2025 JC2 Computing Prelim Paper 1
Uploaded by Kozak327 · 25 August 2026
Preview
Text from the first pagesNJC Mathematics 2025 9569/01/25 [Turn over NATIONAL JUNIOR COLLEGE Mathematics Department General Certificate of Education Advanced Level Higher 2 COMPUTING Paper 1 Written 9569/01 15 Sep 2025 3 hours Additional Materials: Pre-printed A4 Answer Booklet READ THESE INSTRUCTIONS FIRST An answer booklet will be provided with the question paper. You should follow the instructions on the front cover of the answer booklet. If you need additional answer paper, ask the invigilator for a continuation booklet. There are 7 questions totalling 100 marks. Answer all questions. Approved calculators are allowed. The number of marks is given in the brackets [ ] at the end of each question or part question. This document consists of 13 printed pages and 3 blank pages.
2 NJC Mathematics 2025 9569/01//25 [Turn over 1 A Super Fibonacci Sequence (SFS) is a sequence of integers with the property that, from the third term onwards, every term is the sum of all previous terms. For example, in the sequence 1,2,3,6,12,... : • The third term, 3, is 1 + 2 • The fourth term, 6, is 1 + 2 + 3 • The fifth term, 12, is 1 + 2 + 3 + 6 We assume that the first term is always 1. However, we are free to choose the second term. By setting different values for the second term, we generate different sequences. For example: • If the second term is 5, the sequence is: 1,5,6,12,24,48,96,... • If the second term is 6, the sequence is: 1,6,7,14,28,56,112,... a) A recursive function, super_fib_R(term_2, n) is to be written in pseudocode. This function will: • compute the nth term of the Super Fibonacci Sequence with the given second term, term_2. You can assume that n > 0 and term_2 > 0. • returns the nth term. For example, super_fib_R(5, 5) should return 24, since the fifth term of the sequence starting with 1,5,6,12,24, … is 24. An incomplete algorithm for the function is given below: 01 02 03 : : FUNCTION super_fib_R(term_2:INTEGER, n:INTEGER) RETURNS INTEGER IF n = 1 THEN : : : ENDFUNCTION Complete the recursive algorithm in pseudocode with the following requirements: • You may not use any iterative constructs (such as FOR or WHILE loops); the entire solution must rely solely on recursion.
3 NJC Mathematics 2025 9569/01//25 [Turn over • You may not make use of any external function (e.g. SUM) or any helper functions. • You may not use any abstract data types (such as array or list). • You are not allowed to change the function signature. [4] b) Write an algorithm in pseudocode for an iterative function named super_fib_I(term_2, upper) that prints all the terms of a Super Fibonacci Sequence (SFS) up to a given upper limit. • The first term is always 1. • The second term is term_2, provided as an input parameter , is greater than 0. • From the third term onwards, each term is the sum of all previous terms in the sequence. • You can assume that t he upper limit , upper, provided as an input parameter, is greater or equal to term_2. • The function should print each term in the sequence, if it is less than or equal to the given upper limit specified as the input parameter, upper. • You must use an iterative construct (such as a WHILE loop) to generate the sequence. For example, super_fib_I(3,5) should print 1,3,4. [4]
4 NJC Mathematics 2025 9569/01//25 [Turn over c) Using the variables from super_fib_I in 1b), draw a trace table to trace the execution of super_fib_I(3, 10) . Include all variable states and printed output. For example, if the variables a and b are used, the trace table should at minimum look like this: a b output [3] d) Test cases are used to validate the correctness and robustness of your code. Based on the algorithm you have written for the function super_fib_I in 1b). Copy and complete the table below by filling out the appropriate test cases. Type of Test Case Test Case Expected Output Reason of Test Normal super_fib_I(2,7) 1,2,3,6 Inputs should produce correct expected output Normal Inputs should produce correct expected output Boundary Abnormal [4]
5 NJC Mathematics 2025 9569/01//25 [Turn over 2 A engineer is writing code for a network server program that periodically receives data updates from Internet of Things (IoT) devices. The server is implemented in a programming language that supports dynamic memory allocation. The following algorithm describes what is to happen when the server recieves a signal indicating that an IoT device is about to transmit data. 1 allocate 64K bytes of memory to current buffer 2 receive byte stream and store into current buffer 3 IF sender terminates connection before current buffer is full THEN 4 decode data in current buffer and write to a text file 5 release the memory used by the current buffer 6 block and wait for the next transmit signal from IoT device 7 ELSE // buffer is full but there is still incoming data 8 decode data in current buffer and write to a text file 9 allocate another 64K bytes of memory for new buffer 10 assign the new buffer as the current buffer 11 GOTO line 2 12 ENDIF The engineer tested the code by using a simulator to send data to the server program and found it to work correctly. The server is then deployed to run in a production environment. After several days of continuous operation, the server program crashes due to a runtime error. Upon rebooting the server, the program resumes normal operation . Without any further investigation, the engineer claims that it was a intermittent network problem and requests the user to just re-boot the server when it happens again. (a) Discuss whether the engineer is abiding by the code of ethics of a computer professional. [2] (b) Explain how a mistake in the algorithm is causing the problem and how to fix it. [3] (c) Suggest two reasons why the mistake was not identified during testing. [2]
6 NJC Mathematics 2025 9569/01//25 [Turn over 3 A company wants to motivate its staff to be punctual, limit unapproved absences, and reward extra effort while ensuring discipline when necessary. At the end of each quarter (3 months), the HR department reviews each employee’s attendance record. The review process works as follows: • An employee’s punctuality score is assessed — if the employee arrived late to work on more than 3 separate days in a quarter, it is flagged as a punctuality concern. • The absence policy allows for up to 2 unapproved leave days in a quarter. If an employee takes more than that without valid reasons, it is flagged as an absence violation. • The company encourages overtime, so if an employee logs any approved overtime hours in a quarter, it is noted for potential reward - but only if they have maintained satisfactory punctuality and leave records. • Based on the quarterly assessment: − Any punctuality concern or absence violation will result in a salary deduction. − If an employee has both a punctuality concern and an absence violation in the same quarter, they will also receive a formal warning letter for poor attendance discipline. − If an employee shows no punctuality concerns and no absence violations, but has logged overtime, they will receive a performance bonus for their extra effort. − If an employee has any punctuality concerns or absence violations, they are not eligible for the performance bonus, even if they worked overtime.
7 NJC Mathematics 2025 9569/01//25 [Turn over a) Complete the decision table below showing all the possible conditions and their respective actions/outcomes. PunctualityConcern AbsenceViolation OvertimeClocked DeductSalary IssueWarning ReceiveBonus [4] b) Simplify your decision table by rem
Content continues in the PDF. Download PDF
Related notes
- JPJC 2024 JC2 Prelim Paper 2 QPExam Papers · 2024
- JPJC 2024 JC2 Prelim Paper 2 MS v2Exam Papers · 2024
- JPJC 2024 JC2 Year-End Exam H2 Computing Paper 1Exam Papers · 2024
- JPJC 2024 JC2 Year-End Exam H2 Computing Paper 1 Marking SchemeExam Papers · 2024
- 2024 ASR H2 Computing Prelim P1 SolExam Papers · 2024
- 2024 ASR H2 Computing Prelim P1 QnsExam Papers · 2024
- 2025 VJC H2 Computing Prelim Paper 1Exam Papers · 2025
- 2025 VJC H2 Computing Prelim Paper 1 SolutionsExam Papers · 2025
- 2025 TJC H2 Computing Prelim Paper 1 SolutionsExam Papers · 2025
- RVHS 2025 H2 Computing Prelim Paper 1Exam Papers · 2025
- RVHS 2025 H2 Computing Prelim Paper 1 SolutionsExam Papers · 2025
- RI 2025 H2 Computing Prelim Paper 1Exam Papers · 2025
- See all H2 Computing notes

