2024 H2 CP Paper 1 suggested solution
Uploaded by ajjj · 27 April 2025
Preview
Text from the first pages2024 A Level H2 Computing Paper 1 Suggested solution 1 (a)
1 (b) c i n OUTPUT 0 72 0 72 69 0 69 72 1 69 76 1 76 69 1 76 76 1 76 76 2 76 79 2 79 76 2 79 -1 2 -1 79 2 (c) It counts the number of times the next letter’s ASCII code is greater than the current one. (d) (i) 79 = 16 * 4 + 15. Therefore, 79 in hexadecimal is 4F Denary Quotient Remainder Hexadecimal 79 / 16 4 15 4 15 /16 0 15 F (ii) 79 = 2^(6) + 2^(3) + 2^(2) + 2^(1) + 2^(0). Therefore, 79 in binary is 1001111 Denary Quotient Remainder 79 / 2 39 1 39 / 2 19 1 19 / 2 9 1 9 / 2 4 1 4 / 2 2 0 2 / 2 1 0 1 / 2 0 1 (iii) ASCII is restricted to 128 or 256 characters, depending on whether it's 7-bit or 8-bit. ASCII can only represent characters from English languages. It is unable to support
other non-English languages when encoding characters such as accented letters and non-Latin scripts (Chinese, Arabic etc) 2 (a) (b) It is defined in terms of itself since S(n-1) is in the function. It calls itself with a smaller problem as seen in Line 05: RETURN S(n-1) - 3. It has a terminating condition when n = 1 as shown in Line 02. (c) When S(2) is called by the main program, the return address to main is pushed onto the stack. S(2) calls S(1) and the return address to S(2) and the content of n = 2 is pushed onto the stack. Since the base case is reached, 12 is pushed onto the stack. 12 is popped together with the stack frame and is return to S(2). Push new value of 12 – 3 = 9 onto the stack. Pop 9 and return to main. (d) If S(0) is called, it will continuously call itself and ends up in an infinite loop as it will not reach its base case of n = 1. Eventually, it will result in a runtime error caused by stack overflow. (e) FUNCTION S(n : INTEGER) RETURNS INTEGER RESULT 12 WHILE n <> 1 RESULT RESULT – 3 n n − 1 ENDWHILE RETURN RESULT ENDFUNCTION S(5) S(4) S(3) S(2) S(1) Returns 12 Returns 12 – 3 = 9 Returns 9 – 3 = 6 Returns 6 – 3 = 3 Returns 3 – 3 = 0
3 (a) (b) Instantiation is the process when an object of a class is created. (c) (i) Encapsulation is when the private attributes of a class can only be accessed by calling the public method. An example would be to access the private attribute status for Bee, it can only be done by calling the public method get_status(). (ii) Inheritance is when the subclass is derived from the superclass and has its attributes and methods. An example would be Drone, which is a subclass that is derived from its superclass Bee, acquires all the attributes and methods from its superclass. (iii) Polymorphism is when the subclass defines a method with the same name as the method in the superclass but is modified for different behaviour. An example would be the set_energy() method in Queen, which decreases energy by 2, behaves differently from the set_energy() method in Drone, which decreases energy by 1.
(d) Type of test Test data Normal 10 Abnormal 30 Extreme 0 4 (a) (i) (ii) Agents (agent_ref_num, agent_name, salary) Customers (cust_ref_num, cust_name, mobile_ num, email_add) Properties (property_ref_code, address, price, num_of_bedrooms) Viewings (property_ref_code, cust_ref_num, agent_ref_num, date, time_slot) (iii) CREATE TABLE Properties ( property_ref_code INTEGER PRIMARY KEY NOT NULL, address TEXT NOT NULL, price INTEGER NOT NULL, num_of_bedrooms INTEGER NOT NULL ) (b) (i) A backup is a copy of data stored separately from the original, allowing recovery in case of data loss. Backing up data is essential to ensure business continuity, data integrity, and protection against data loss caused by various factors. (ii) Data archiving is the process of moving inactive, infrequently accessed, or historical data to a separate storage system for long- term retention while keeping it accessible when needed. Data archiving is necessary to free up storage space, improve system performance, compliance to data retention laws and keeping historical data accessible for audits, research, or legal needs. Agents Customers Properties Viewings
5 (a) (i) (ii) Each node has at most 2 children: a left child and a right child. For every node in the tree, the left subtree contains only nodes with smaller values than the node and the right subtree contains only nodes with greater values than the node. (iii) The dataValue at index 6 will be updated with “Madrid” and its leftPtr and rightPtr will be changed to −1. The leftPtr at index 2 will be changed to 6. The freePtr will be changed to 7. (b) A static data structure has a fixed size which means that elements cannot be inserted once it is full. A static data structure allocates memory at compile time which means that some memory may be allocated but not used, leading to memory wastage. ● add in context for first point ● extension to first point, need to increase size if full. (c) (i) PROCEDURE reverseInOrder(rootPtr: INTEGER) IF rootPtr <> −1 THEN reverseInOrder(bst[rootPtr].rightPtr) OUTPUT bst[rootPtr].dataValue reverseInOrder(bst[rootPtr].leftPtr) ENDIF ENDPROCEDURE (ii) Tokyo, Rome, Paris, New York, London, Beijing Beijing London Paris New York Rome Tokyo
6 (a) It is a network model where there is an always -on host called the server which waits for other hosts called clients to send requests to initiate the communication session. The server processes the request and returns a response with the requested data, result, or acknowledgment. The clients do not directly communicate with each other. (b) An intranet is a private network built within an organisation that restricts access to authorised users within the organisation. It allows sharing of information and resources securely within a controlled environment. (c) Networking protocols are essential for successful data transmission over a network as it define a set of rules that must be agreed upon between the sender and receiver to ensure reliable and efficient communication. For example, SMTP is used to send emails, ensuring the proper format and delivery of messages, while HTTPS provides a secure, encrypted connection for accessing the company’s intranet, protecting data from unauthorized access. (d) (i) The purpose of a digital signature is to authenticate the sender of a digital message or document and that the digital message has not been altered or tampered with during the transmission. (ii) The sender uses a hash function to create a hash digest of the document. The sender, Alice, encrypts the hash digest using her private key and this encrypted hash digest is the digital signature. The sender then sends the original message and the digital signature to the receiver, Bob. (e) Bob will use Alice’s public key to decrypt the digital signature to obtain the original hash digest created by Alice. Next, Bob will create a new hash digest from the modified document received by passing it through the hash function. If the two hashes do not match, it means that the document has been altered. The mismatch in the hash digests alerts Bob that Alice’s original document has been intercepted and modified.
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

