2023 RI P1 Question Paper
Uploaded by Kozak327 · 8 September 2026
Preview
Text from the first pages© RI2023 [Turn over CANDIDATE NAME CLASS 23 COMPUTING 9569/01 Paper 1 Written September 2023 3 hours READ THESE INSTRUCTIONS FIRST Answer papers will be provided with the question paper. Write your name and class on all the work you hand in. Write in dark blue or black pen. Answer all questions. Approved calculators are allowed. You are reminded of the need for clear presentation in your answers. The number of marks is given in brackets [ ] at the end of each question or part question. The total number of marks for this paper is 100. FOR EXAMINER’S USE Q1 Q2 Q3 Q4 Q5 Q6 Q7 TOTAL 100 This document consists of 7 printed pages and 1 blank page. RAFFLES INSTITUTION Mathematics Department RAFFLES INSTITUTION 2023 YEAR 6 PRELIMINARY EXAM
2 H2 COMP 9569/2023 RI Year 6 Prelim Exam 1 A bookshop keeps a record of their books using a database. Each book is about a single subject. Each subject has a name and description. There may be more than one book about each subject. Each book has a unique book number, title, and year of publication. A book may have more than one author. Each author may have written more than one book. There are two possible roles of an author: main author or co-author. The first name, last name, and nationality of the author are recorded. Four tables are identified in the database: • Book • Subject • Author • BookAuthor (a) Draw an E-R diagram and show the relationships between these four tables that represent a fully normalised relational database. [3] (b) Write table definitions for each of the tables using this format: TableName (Attribute1, Attribute2, Attribute3, …) (i) Book [2] (ii) Subject [2] (iii) Author [2] (iv) BookAuthor [2] (c) The bookshop wishes to determine which authors have written the most books. Write an SQL query that will output the number of books for each author, together with the first name, last name, and nationality of the author. List the results in descending order of total number of books written. [5]
3 H2 COMP 9569/2023 RI Year 6 Prelim Exam [Turn over 2 A programmer is designing a social media app where users can post photos, videos, and status updates. Object-oriented programming will be used to model the posts. For every post, the data that will be stored include • username of user who posted, • timestamp of the post, • content of the post which is text-based, • number of “like” by other users who like the post. For photo and video posts, the URL of the photos and videos are also stored. (a) Draw a class diagram for the situation described, showing • the superclass • any subclasses • inheritance • properties • appropriate methods • polymorphism [8] (b) Explain how inheritance is achieved with examples from this situation. [3] To increase the engagement of the posts, users will be allowed to add comments. Each comment will record the username, timestamp and text. (c) Suggest changes to the class diagram to enable users to add comments for the posts. [3] In anticipation of a large number of users and posts for the social media app , the programmer decided to use a NoSQL database to store information for the app. (d) Explain why the programmer may choose to use a NoSQL database in this situation. [3] Social media apps gather substantial user data, requiring careful consideration of privacy concerns. (e) State two ways in which data protection laws help to minimise privacy concerns. [2]
4 H2 COMP 9569/2023 RI Year 6 Prelim Exam 3 A program uses a binary search tree to store ordered data. The programmer implements the binary search tree using linked nodes. Each node comprises three parts: left_ptr, right_ptr and number_item. The number_item stores the data as an integer. The left_ptr is a pointer that points to the left of the current node, while right_ptr is a pointer that points to the right of the current node. left_ptr number_item right_ptr The root of the binary search tree is stored in a variable, root. A representation of the binary search tree is as follows: Function A is an operation on the binary search tree. The function takes a parameter and returns the data of a node. 1 FUNCTION A (root_node: Node) RETURNS INTEGER 2 current_node root_node 3 IF current_node = NULL THEN 4 RETURN NULL 5 ENDIF 6 WHILE current_node.right_ptr <> NULL 7 current_node current_node.right_ptr 8 ENDWHILE 9 RETURN current_node.number_item 10 ENDFUNCTION (a) State the return value of function call A(root) when it is operated on the above binary search tree. [1] (b) What does function A achieve when it is operated on the binary search tree? [1] (c) Using pseudocode, write a recursive version of function A that achieves the same purpose. [5] root 9 8 6 11 12 18 15 Node:
5 H2 COMP 9569/2023 RI Year 6 Prelim Exam [Turn over Besides using a binary search tree, the programmer also considers using a singly linked list to store ordered data. A linked list consists of nodes, where each node holds a value and a pointer to the next node in the sequence. (d) If frequent search operations are required, explain whether an ordered linked list or a binary search tree is preferred for storing the ordered data. [2] (e) If there are frequent insertions and deletions of nodes, explain whether an ordered linked list or a binary search tree is preferred for storing the ordered data. [2] 4 A company offers its employees the option of health insurance. To be eligible for health insurance , the employee must be at least 21 years old , be employed by the company for at least 6 months, and pass a medical exam. If an employee is at least 21 years old and employed for at least 6 months, but fails the medical exam, then health insurance will be offered for a probationary period. If an employee passes the medical exam, and meets only one of the first two criteria (at least 21 years old and employed for at least 6 months) , then health insurance for a probationary period may also be offered. (a) Create a decision table to show all the possible conditions and actions for an employee's eligibility for health insurance. [4] (b) Simplify your solution by removing redundancies. [2] (c) Write a pseudocode algorithm as a function to determine if an employee is eligible for health insurance, health insurance for a probationary period, or not eligible for health insurance at all. Use the three criteria as parameters and these statements as return values: • “Eligible for health insurance” • “Eligible for health insurance for a probationary period” • “Not eligible for health insurance” [4] (d) The company manages the personnel records for all its employees. Explain why both backing up and archiving data of the records are important for the company. [3]
6 H2 COMP 9569/2023 RI Year 6 Prelim Exam 5 The algorithm defines a recursive function named K that takes two parameters. 1 FUNCTION K(number, base) //number and base are integers 2 DECLARE digitString, tempString, digit : STRING 3 DECLARE remainder, quotient : INTEGER 4 digitString "0123456789ABCDEF" 5 IF number = 0 THEN 6 RETURN "" 7 ENDIF 8 remainder number MOD base 9 digit digitString[remainder] //base-0 indexing 10 quotient INTEGER(number / base) 11 tempString K(quotient, base) 12 RETURN CONCATENATE(tempString, digit) //tempString+digit 13 ENDFUNCTION (a) Copy and complete the trace table for function call K(42, 16). [4] Function call number base remainder digit quotient tempString Return
Content continues in the PDF. Download PDF
Related notes
- 2024 ACJC Computing PromoExam Papers · 2024
- 2023 ACJC Promo QPExam Papers · 2023
- 2022 ACJC Computing Promo Paper 2Exam Papers · 2022
- 2021 ACJC Computing Promo Paper 2Exam Papers · 2021
- 1992 AJC Computing QPExam Papers · 1992
- 2023 YIJC P2 Question PaperExam Papers · 2023
- 2023 YIJC P1 Question PaperExam Papers · 2023
- 2023 RVHS P2 CombinedExam Papers · 2023
- 2023 RI P2 Question PaperExam Papers · 2023
- 2023 NYJC-VJC-TJC P2 Question PaperExam Papers · 2023
- 2023 NJC P2 Question PaperExam Papers · 2023
- 2023 JPJC P2 SolutionsExam Papers · 2023
- See all H2 Computing notes

