Programming
471 questions. Open a question to solve it and check the official answer.
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 …
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(). ........................…
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 ..............…
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…
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…
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…
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…
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…
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…
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…
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 …
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(). ........................…
Constructs · 3 marks · official answer ready
(i) Describe, using the bank as an example, the key features of a client-server model. ............................................................................................…
Constructs · 3 marks · official answer ready
(b) Describe the purpose of disk repair software. .................................................................................................................................…
Constructs · 2 marks
(iii) Describe the following video terms. Temporal redundancy ........................................................................................................ ............…
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…
Constructs · 3 marks · official answer ready
(i) Complete the database design for the hotel by writing the attributes for each table. CUSTOMER( ................................................................................…
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. .............................................................…
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 .........................................................…
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…
