Data types and structures
283 questions. Open a question to solve it and check the official answer.
Data types and records · 3 marks · official answer ready
(a) Write pseudocode to define the record type customer. ..........................................................................................................................…
Arrays · 4 marks · official answer ready
(i) The table shows the contents of the three fields in each record stored in the 1D array binaryTree. Complete the table to show the contents of binaryTree from part (a). rootPoi…
Data types and records · 2 marks · official answer ready
(ii) Write pseudocode to declare the array binaryTree to store up to 100 objects of type node. ....................................................................................…
Data types and records · 2 marks · official answer ready
(a) Write the pseudocode record declaration for the data type Booking. ............................................................................................................…
Data types and records · 3 marks · official answer ready
(a) Write pseudocode to define the record type customer. ..........................................................................................................................…
Arrays · 4 marks · official answer ready
(i) The table shows the contents of the three fields in each record stored in the 1D array binaryTree. Complete the table to show the contents of binaryTree from part (a). rootPoi…
Data types and records · 2 marks · official answer ready
(ii) Write pseudocode to declare the array binaryTree to store up to 100 objects of type node. ....................................................................................…
Files · 2 marks · official answer ready
(ii) Give two other examples of applications that can use the client-server model. 1 ..............................................................................................…
Data types and records · 4 marks · official answer ready
(i) Programming languages support different data types. Complete the table by giving a suitable data type for each example value. Example value Data type "NOT TRUE" − 4.5 NOT FALS…
Data types and records · 7 marks · official answer ready
3 The following is a function design in pseudocode. Line numbers are given for reference only. 10 FUNCTION Check(InString : STRING) RETURNS BOOLEAN 11 12 DECLARE NumDots : INTEGER…
Data types and records · 2 marks · official answer ready
(ii) State the value returned when the function is called using the expression shown. Justify your answer. Value ..................................................................…
Files · 1 mark · official answer ready
(a) State one reason for storing data in a file rather than in an array. ..........................................................................................................…
Files · 8 marks · official answer ready
(c) Write pseudocode for the module FindDuplicates(). The module description is given in the table on page 12. ....................................................................…
Files · 3 marks · official answer ready
(i) Write pseudocode for the modified ClearArray() procedure. .....................................................................................................................…
Data types and records · 2 marks · official answer ready
(ii) Write program code for a statement that calls the modified ClearArray() procedure to clear the array Duplicates to "Empty". Programming language .............................…
Data types and records · 3 marks · official answer ready
(a) The array Result is a 1D array of type INTEGER. Write pseudocode to declare the array and to initialise all elements to zero. .................................................…
Data types and records · 7 marks · official answer ready
5 The module headers for three modules in a program are defined in pseudocode as follows: Pseudocode module header PROCEDURE Lookup(P4 : INTEGER, BYREF M4 : STRING) FUNCTION Updat…
Data types and records · 3 marks · official answer ready
(c) CountTimes() is to be used to count how many unused elements there are in the Leavers array. An unused element is one that contains an empty string. The module description is …
Data types and records · 1 mark · official answer ready
(ii) State the value returned when function Check is called as shown in part (b)(i). ..............................................................................................…
Data types and records · 4 marks · official answer ready
(c) The function Check() is to be tested. State two different invalid string values that could be used to test the algorithm. Each string should test a different rule. Justify you…
