Computer Science 9608 · 10

Data types and structures

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

Reset
2021 May-June · Paper 21 · Q4(a)

Data types and records · 6 marks · official answer ready

(a) Write program code to implement this amended procedure ScanArray(). Visual Basic and Pascal: You should include the declaration statements for variables. Python: You should sh…

2021 May-June · Paper 21 · Q6(c)

Data types and records · 16 marks · official answer ready

(c) The module description of Unpack() is repeated here for reference. Module Description • called with two parameters: o an array index Unpack() o a string value read from one li…

2021 May-June · Paper 22 · Q5(b)(ii)

Data types and records · 6 marks · official answer ready

(ii) The function, Verify(), is to be amended as follows: • if the UserID is "Guest", a password is not required and TRUE should be returned • output a message to try again if the…

2021 May-June · Paper 22 · Q6(a)

Arrays · 11 marks · official answer ready

(a) Write program code for the module StockSummary(). Visual Basic and Pascal: You should include the declaration statements for variables. Python: You should show a comment state…

2021 May-June · Paper 22 · Q6(c)

Data types and records · 14 marks · official answer ready

(c) The module description of GetValidFilename() is as follows: Module Description • prompts and inputs a filename • validates the filename by checking that it: • is between 4 and…

2021 May-June · Paper 23 · Q6(c)

Data types and records · 17 marks · official answer ready

(c) Two additional modules are required: Module Description • called with a STRING representing a product group (for example, "ABLK") Lookup() • searches the Summary array for the…

2019 October-November · Paper 21 · Q1(b)(i)

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…

2019 October-November · Paper 21 · Q6(d)(ii)

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 .............................…

2019 October-November · Paper 22 · Q6(c)

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 …

2019 May-June · Paper 21 · Q6(b)

Data types and records · 8 marks · official answer ready

(b) The module, FindCD(), will check whether a given CD exists in the collection. The module will be implemented as a function. The function will: • be called with two strings as …

2019 May-June · Paper 23 · Q6(c)

Data types and records · 3 marks · official answer ready

(c) ProcessArray() is modified to make it general purpose. It will now be called with two parameters as follows: • an array • a string representing the name of a class contact fil…

2018 October-November · Paper 23 · Q4(d)(i)

Data types and records · 3 marks · official answer ready

(i) CharArray is a 1D array of type CHAR. It contains 200 elements. Write program code to change all the numeric characters ('0' to '9') in CharArray to '*'. Programming language …

2018 May-June · Paper 21 · Q1(b)(ii)

Data types and records · 9 marks · official answer ready

1 (a) A program stores data about hospital patients. Give a suitable identifier name for each of the data items. Description of data item Suitable identifier name The temperature …

2018 May-June · Paper 21 · Q7

Data types and records · 7 marks · official answer ready

7 A function, ProcessMarks(), is required to analyse test marks for a class of students. • There are 20 students in the class. • A mark is between 0 and 100. • The marks for the c…

2018 May-June · Paper 23 · Q7

Data types and records · 6 marks · official answer ready

7 A function, IsFactor() takes two integer parameters and checks whether the second parameter is a factor of the first parameter. For example IsFactor(6,3) would return TRUE as si…

2018 May-June · Paper 32 · Q1(c)(i)

Data types and records · 4 marks · official answer ready

(i) Write pseudocode to define the data type StudentAssessment. ...................................................................................................................…

2018 May-June · Paper 32 · Q1(c)(ii)

Data types and records · 3 marks · official answer ready

(ii) Data about all students and their assessments are stored in a file that uses random organisation. The StudentID is used as the key field. The program allows a user to enter d…

2016 October-November · Paper 21 · Q19(d)(ii)

Arrays · 18 marks

(ii) State two things that built-in and user-defined functions have in common. 1 ..................................................................................................…

2016 October-November · Paper 21 · Q19(e)(v)

Data types and records · 7 marks

(v) Answer2 ................................... [1] 19 Appendix Built-in functions (pseudocode) ONECHAR(ThisString : STRING, Position : INTEGER) RETURNS CHAR returns the single ch…

2016 October-November · Paper 22 · Q5(b)(iii)

Data types and records · 4 marks · official answer ready

(iii) Program code is to be designed and written for step 02.3 The program will use these identifiers: Identifier Data type Description PlayerName ARRAY[1 : 8] OF STRING Stores th…