Computer Science For First Examination In 2021 9618 · 10

Data types and structures

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

2024 October-November · Paper 32 · Q3(b)

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…

2024 October-November · Paper 32 · Q11(b)

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 …

2024 October-November · Paper 33 · Q5(a)

Files · 3 marks · official answer ready

5 (a) Explain what is meant by a hashing algorithm in the context of file access. .................................................................................................…

2024 October-November · Paper 42 · Q2(d)

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…

2024 October-November · Paper 42 · Q4(d)

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…

2024 May-June · Paper 13 · Q7(e)(ii)

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…

2024 May-June · Paper 21 · Q3(a)

Introduction to abstract data types · 3 marks · official answer ready

(a) Describe the linked list immediately after initialisation, before any data items are added. ...................................................................................…

2024 May-June · Paper 21 · Q3(b)

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…

2024 May-June · Paper 21 · Q4

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…

2024 May-June · Paper 21 · Q5(b)(i)

Data types and records · 7 marks

(i) Write the single line of pseudocode. ..................................................................................................................................... [1]

2024 May-June · Paper 21 · Q5(b)(ii)

Data types and records · 7 marks · official answer ready

(ii) State where this new line should be placed. ..................................................................................................................................…

2024 May-June · Paper 21 · Q8(a)

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…

2024 May-June · Paper 22 · Q1(b)

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 …

2024 May-June · Paper 22 · Q3(a)(i)

Data types and records · 4 marks · official answer ready

(i) Write pseudocode to declare the record structure for type Component. ..........................................................................................................…

2024 May-June · Paper 22 · Q8(b)

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 …

2024 May-June · Paper 23 · Q3(a)(i)

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…

2024 May-June · Paper 23 · Q3(a)(ii)

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 …

2024 May-June · Paper 23 · Q3(b)

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…

2024 May-June · Paper 23 · Q6(a)

Data types and records · 6 marks · official answer ready

(a) Write pseudocode for procedure Progress(). ....................................................................................................................................…

2024 May-June · Paper 23 · Q6(b)(ii)

Files · 1 mark · official answer ready

(ii) State one benefit of increasing the number of steps. .........................................................................................................................…