2023 C2 Prelim P1 Qn
Uploaded by user7295 · 14 October 2023
Preview
Text from the first pagesPage 1 of 8 HWA CHONG INSTITUTION C2 PRELIMINARY EXAMINATION 2023 COMPUTING Higher 2 13 Sept 2023 Paper 1 (9569 / 01) 1400 -- 1700 hrs READ THESE INSTRUCTIONS FIRST An answer booklet will be provided with this 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. Answer ALL questions. Approved calculators are allowed. 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. This document consists of 8 printed pages.
Page 2 of 8 1. The examinations department of a school needs to store data on the examinations taken by its students. Examination subjects are classified as one of the two types, namely academic subjects and practical subjects. For all subjects, the data that will be stored include: • Subject code • Subject name • Subject type The assessment process for an academic subject comprises two written papers. The duration of each of these two papers will be stored. For the practical subject’s assessment process there are no written papers but there is a single practical examination. A practical examination has a duration and a final date. (a) Draw a diagram that shows suitable classes and their relationships for a solution to this problem that uses OOP techniques. Include approp riate attributes and methods in each class. [6] (b) The school also offers vocational subjects to their students. A vocational subject has no formal examinations, but the assessment is based on the work that the students complete throughout the course. However, this coursework has to be completed by a certain date. Suggest any changes that need to be made to the classes used in part (a). [3] (c) Explain the difference between a class and an object. [2] (d) Give two benefits of Object-Oriented programming. [2] 2. (a) Describe one advantage and one disadvantage of client-server network. [2] (b) Describe one disadvantage of packet switching and how the problem can be handled. [2] (c) Describe two differences between switch and router in the TCP/IP model. [2] (d) Explain the term Domain Name Server (DNS) and how it works. [5]
Page 3 of 8 3. (a) Give one example of multi-factor authentication. [1] (b) Explain how a Denial of Service (DOS) attack can co mpromise an internal server and suggest one protection scheme to detect a DOS attack. [3] (c) Give two purposes of using digital signature and describe how it works. [8] 4. (a) The following are the inorder and postorder traversal of a binary tree whose nodes are labelled 1, 2, . . . , 9. Inorder: 4, 7, 2, 1, 5, 3, 8, 6, 9 Postorder: 7, 4, 2, 5, 8, 9, 6, 3, 1 (i) Draw the binary tree with the nodes labelled. [3] (ii) Give the preorder traversal of this binary tree. [2] (b) The following names are to be inserted in a binary search tree in the order given: Lorna, Peter, Romeo, Betty, Anthony, Linda, Matthew Assuming an empty tree to start with, show how these names w ill be stored by drawing a tree diagram. [2] (c) By using suitable example and diagram, describe a situation where a binary search tree becomes inefficient. [2] (d) Give an advantage of using a binary search tree for storing data over a linked list. [1]
Page 4 of 8 5. In a country club, every member is issued a Membership Identification Number (MIN). MIN is a unique number comprises of 10 digits separated by two dashes. The last digit of MIN is a check digit using a modulus-10 system. Consider the MIN 456-789-5468. The check digit is calculated based on the left-most 9 digits. The first step is to double every alternate digits, starting with the second-last digit and moving left. Then sum all the digits, including both the unchanged digits as well as those doubled (e.g. 18 contributes 1 + 8). The following illustrates the process: The total sum 52 is then divided by 10. If the remainder is 0, then the check digit is 0, otherwise, use 10 to subtract by the remainder to obtain the check digit. (a) Using pseudocode, write an algorithm to validate a MIN number. [6] (b) Using the algorithm in part (a), determine whether the following MIN numbers are valid. (i) 456-789-0126 (ii) 986-745-0124 [2] (c) The algorithm for verifying MIN number contains a few weaknesses. Identify a weakness and explain how it can be solved. [2] Digit Double Sum of digits 6 6 4 8 (0+8) 5 5 9 18 (1+8) 8 8 7 14 (1+4) 6 6 5 10 (1+0) 4 4 Total Sum 52
Page 5 of 8 6. The school wants to deploy an efficient method to store and search students’ names. Student A suggests entering the names into an array and using binary search. (a) Explain why the array must be sorted before performing binary search. [1] (b) State two features of a successful recursive function. [2] Names are stored in Array in ascending order. Student A writes the recursive function below to search for Target in Array. It returns True if Target is found and False otherwise. 01 FUNCTION B(Array, Target, Low, High) RETURNS BOOLEAN 02 IF Low > High THEN 03 RETURN False 04 ELSE 05 Mid (Low + High) div 2 06 IF Target < Array[Mid] THEN 07 B(Array, Target, Low, Mid – 1) 08 ELSE IF Target > Array[Mid] 09 B(Array, Target, Mid + 1, High) 10 ELSE 11 RETURN True 12 ENDIF 13 ENDIF 14 ENDFUNCTION Note: the div operation returns an integer value after division, e.g. 7 div 2 = 3. (c) State the significance of line 02. [1] (d) Name the type of error for lines 07 and 09. Modify these two lines to make the function work. [2] (e) Write down the statement to call the function to perform the binary search. [1] Student B suggests storing the names in a hash table and using hash table search. (f) State two features of a good hashing algorithm. [2] (g) Explain how two different records hashing to the same location can be managed. [2] (h) Use time complexity to explain the advantage of a hash table search might have over a binary search. [2]
Page 6 of 8 7. In a football league, there are several teams. A database is created to store data about the clubs and the players that play for them. • Each player belongs to a single club. • A club can have multiple players, but only one coach. • Each player can play multiple positions. This table shows the data about the clubs and their players: ClubID Club Name Club City Coach Name PlayerID Player Name Player Age Position Code 14 Cannons Islington Mickey 9663 Dale 25 GK 4336 Aliba 22 DF 2603 Blanc 25 DF MF 8257 Bukasa 22 DF MF FW 1160 Marty 22 MF FW 3984 Fan 24 DF MF 2115 Øguard 24 MF
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

