Data types and structures
223 questions. Open a question to solve it and check the official answer.
Data types and records · 4 marks · official answer ready
(b) A programmer defines a record, Order, to store the following data: • account number • order number • order price • order date. Write pseudocode statements to define this recor…
Arrays · 4 marks · official answer ready
(b) A 2D array is used to store the nodes of the linked list in part (a). Complete the diagram using your answer for part (a). RootPtr Index LeftPtr Data RightPtr 0 0 25 1 4 2 36 …
Files · 3 marks · official answer ready
5 (a) Explain what is meant by a hashing algorithm in the context of file access. .................................................................................................…
Data types and records · 3 marks · official answer ready
(d) The function ReturnAllData() accesses TheQueue. It concatenates all the integer values that have been inserted into the queue’s array, starting from the value stored at HeadPo…
Data types and records · 3 marks
(d) The function ReturnAllData() accesses TheQueue. It concatenates all the integer values that have been inserted into the queue’s array, starting from the value stored at HeadPo…
Files · 4 marks · official answer ready
(ii) Some program libraries include Dynamic Link Library (DLL) files. Describe the benefits of a programmer using a library with DLL files instead of using a library that does not…
Introduction to abstract data types · 3 marks · official answer ready
(a) Describe the linked list immediately after initialisation, before any data items are added. ...................................................................................…
Arrays · 5 marks · official answer ready
(b) A program will be written to include a linked list to store alphanumeric user IDs. The design uses two variables and two 1D arrays to implement the linked list. Each array ele…
Arrays · 6 marks · official answer ready
4 A global 1D array Data contains 100 elements of type integer. A function Check() will: • total the element values in odd index locations (1, 3, 5 ... 97, 99) • total the element…
Data types and records · 7 marks
(i) Write the single line of pseudocode. ..................................................................................................................................... [1]
Data types and records · 7 marks · official answer ready
(ii) State where this new line should be placed. ..................................................................................................................................…
Data types and records · 6 marks · official answer ready
(a) A function IsRA() will: • take three sets of integers as parameters representing the coordinates of the three endpoints that form a triangle • return TRUE if the endpoints for…
Data types and records · 4 marks · official answer ready
(b) Program variables have data types as follows: Variable Data type MyChar CHAR MyString STRING MyInt INTEGER Complete the table by filling in each gap with a function (from the …
Data types and records · 4 marks · official answer ready
(i) Write pseudocode to declare the record structure for type Component. ..........................................................................................................…
Data types and records · 6 marks · official answer ready
(b) The teacher has defined the first program module as follows: Module Description DeleteSpaces() • called with a parameter of type string representing a line of pseudocode from …
Data types and records · 3 marks · official answer ready
(i) A program uses a variable ThisIndex as the array index to access a record. Write a pseudocode clause to check whether or not the weight of an individual component is within th…
Data types and records · 1 mark · official answer ready
(ii) When batches of less than 1000 components are processed, it is necessary to indicate that certain elements in the array are unused. Suggest how an unused array element could …
Data types and records · 5 marks · official answer ready
(b) A module InRange() will: • be called with an integer parameter representing an index value of a record in the Batch array • check if the weight of the indexed component is wit…
Data types and records · 6 marks · official answer ready
(a) Write pseudocode for procedure Progress(). ....................................................................................................................................…
Files · 1 mark · official answer ready
(ii) State one benefit of increasing the number of steps. .........................................................................................................................…
