Computer Science 9608 · 11

Programming

471 questions. Open a question to solve it and check the official answer.

2021 May-June · Paper 41 · Q5(a)

Constructs · 4 marks · official answer ready

(a) The pseudocode function binarySearch()performs a binary search to find a given value in the global array, dataArray. If the value is found, the function returns its index. If …

2021 May-June · Paper 41 · Q7(b)

Constructs · 3 marks · official answer ready

(b) The function pop() pops and returns the item from the top of the stack. If the stack is empty, it returns −1. Write pseudocode for the function pop(). ........................…

2021 May-June · Paper 42 · Q2(b)(i)

Structured programming · 2 marks · official answer ready

(i) The function Hash() takes the booking ID as a parameter, calculates and returns the hash value. Write program code for the function Hash(). Programming language ..............…

2021 May-June · Paper 42 · Q4(b)(i)

Structured programming · 5 marks · official answer ready

(i) The function Enqueue() takes the value to be added to the queue as a parameter. The function returns TRUE if the item was added, or FALSE if the queue is full. Complete the ps…

2021 May-June · Paper 42 · Q4(b)(ii)

Constructs · 5 marks · official answer ready

(ii) The function Dequeue() returns the value at the head of the queue, or −1 if the queue is empty. Complete the pseudocode for the function Dequeue(). FUNCTION Dequeue() RETURNS…

2021 May-June · Paper 42 · Q5

Constructs · 5 marks · official answer ready

5 The following procedure performs an insertion sort on the global array TheArray that has 10 elements. Complete the pseudocode for the procedure InsertionSort(). PROCEDURE Insert…

2021 May-June · Paper 42 · Q6(a)

Constructs · 4 marks · official answer ready

(a) Complete the decision table for the social networking website. Available username N Y N Y N Y N Y Conditions Suitable password N N Y Y N N Y Y Age > 16 N N N N Y Y Y Y “Too yo…

2021 May-June · Paper 42 · Q6(b)

Constructs · 3 marks · official answer ready

(b) Simplify the decision table by removing the redundancies. Available username Conditions Suitable password Age > 16 “Too young” “Choose another Actions username” “Password does…

2021 May-June · Paper 43 · Q1(a)

Constructs · 5 marks · official answer ready

(a) The state-transition diagram shows the different states of the vending machine. Complete the state-transition diagram. .......................... Total the money Cancel insert…

2021 May-June · Paper 43 · Q2(b)(iii)

Structured programming · 5 marks · official answer ready

(iii) The function, getCustomer(): • takes the customer ID as a parameter • passes the customer ID to the function getRecordLocation(), which returns the calculated hash value • r…

2021 May-June · Paper 43 · Q5(a)

Constructs · 4 marks · official answer ready

(a) The pseudocode function binarySearch()performs a binary search to find a given value in the global array, dataArray. If the value is found, the function returns its index. If …

2021 May-June · Paper 43 · Q7(b)

Constructs · 3 marks · official answer ready

(b) The function pop() pops and returns the item from the top of the stack. If the stack is empty, it returns −1. Write pseudocode for the function pop(). ........................…

2019 October-November · Paper 11 · Q4(a)(i)

Constructs · 3 marks · official answer ready

(i) Describe, using the bank as an example, the key features of a client-server model. ............................................................................................…

2019 October-November · Paper 12 · Q1(b)

Constructs · 3 marks · official answer ready

(b) Describe the purpose of disk repair software. .................................................................................................................................…

2019 October-November · Paper 12 · Q6(e)(iii)

Constructs · 2 marks

(iii) Describe the following video terms. Temporal redundancy ........................................................................................................ ............…

2019 October-November · Paper 12 · Q7(e)(iii)

Constructs · 6 marks

7 ............................ [4] 12 (e) Dominic sends his videos to his colleagues over the Internet using bit streaming. (iii) Describe the following video terms. Temporal redu…

2019 October-November · Paper 13 · Q3(a)(i)

Constructs · 3 marks · official answer ready

(i) Complete the database design for the hotel by writing the attributes for each table. CUSTOMER( ................................................................................…

2019 October-November · Paper 13 · Q6(a)(iii)

Programming basics · 1 mark · official answer ready

(iii) Identify the line number of the JavaScript code that takes data the user has input and stores it in a variable. .............................................................…

2019 October-November · Paper 21 · Q1(a)(i)

Constructs · 3 marks · official answer ready

(i) This pseudocode lacks features that would make it easier to read and understand. State three such features. Feature 1 .........................................................…

2019 October-November · Paper 21 · Q1(b)(ii)

Constructs · 4 marks · official answer ready

(ii) Evaluate each expression in the following table. If an expression is invalid then write ‘ERROR’. Refer to the Appendix on page 16–17 for the list of built-in functions and op…