Data types and structures
223 questions. Open a question to solve it and check the official answer.
Data types and records · 3 marks · official answer ready
(iii) The method Traverse() concatenates the integer data from the nodes in the linked list, starting with the node stored in HeadNode. The method returns the final string with ea…
Files · 2 marks · official answer ready
(i) Describe the file management tasks carried out by an OS. ......................................................................................................................…
Files · 3 marks · official answer ready
(c) The student used a program library when writing their program. Explain the benefits to the student of using library files when writing a program. .............................…
Data types and records · 6 marks · official answer ready
(c) The module to perform the checks and calculation will be implemented as a function. The function will need to return both a real and a Boolean value. To achieve this a record …
Data types and records · 5 marks · official answer ready
(a) Complete the structure chart for these modules. Connect T1 [5]
Data types and records · 2 marks · official answer ready
(b) Explain the meaning of the curved arrow symbol used in the diagram in part (a). ...............................................................................................…
Arrays · 3 marks · official answer ready
(d) The new module referred to in part (c) introduces three new variables. Complete the following table by giving the appropriate data type for each. Variable name Used to store D…
Arrays · 7 marks · official answer ready
(a) Complete the pseudocode for the procedure Special(). Assume that both arrays are global. PROCEDURE Special() ..................................................................…
Data types and records · 3 marks · official answer ready
(d) Part of the coffee shop program contains three program modules as follows: • Module Init() has no parameters and returns a Boolean. • Module Reset() takes a string as a parame…
Data types and records · 7 marks · official answer ready
(a) Write pseudocode for module Assign(). .........................................................................................................................................…
Data types and records · 7 marks · official answer ready
(b) A new module will store the contents of the Character array in a text file. The module is defined as follows: Module Description Save() • form a string from each record with f…
Data types and records · 2 marks · official answer ready
(c) The program is changed and the record type definition is modified as follows: TYPE CharacterType DECLARE Player : INTEGER DECLARE Role : STRING DECLARE Name : STRING DECLARE L…
Data types and records · 2 marks · official answer ready
(d) The save operation is to be extended so that multiple files may be saved as the game progresses. This will allow the user to restore the game from any saved position. The file…
Data types and records · 3 marks · official answer ready
(b) Complete the table by giving the appropriate data type in each case. Variable Example data value Data type Available TRUE Received "18/04/2021" Index 100 [3]
Data types and records · 1 mark · official answer ready
(i) State why the value 0 has been selected as the null pointer. ..................................................................................................................…
Data types and records · 1 mark · official answer ready
(ii) Give the range of valid values that could be assigned to variable HeadPointer. ...............................................................................................…
Arrays · 0 marks
4 An examination paper has a maximum of 75 marks. One of five pass grades (A to E) is assigned, depending on the mark obtained. The lowest mark for a given grade is known as the g…
Data types and records · 7 marks · official answer ready
(a) Complete the pseudocode for module Count(). PROCEDURE Count(ThisPlayer : INTEGER, ThisRole : STRING) ..........................................................................…
Data types and records · 7 marks · official answer ready
(b) The Character array data has been saved in the text file SaveFile.txt Each line of the file contains one element of the array (one record). New modules are defined: Module Des…
Files · 3 marks · official answer ready
5 (a) Explain what is meant by a hashing algorithm in the context of file access. .................................................................................................…
