10.2 Arrays
40 questions in this subtopic. Open a question to solve it and check the official answer.
Arrays · 2 marks · official answer ready
(ii) A 1D array Rental containing 500 elements is used to store the data for all rental records. Write pseudocode to declare the Rental array. ....................................…
Arrays · 1 mark · official answer ready
(i) Extend the main program to call FindValues() Save your program. Copy and paste the program code into part 1(f)(i) in the evidence document. [1]
Arrays · 1 mark · official answer ready
(ii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot(s) into part 1(f)(ii) in the evidence document. [1] 4
Arrays · 3 marks · official answer ready
(a) Write program code to declare the array local to the main program and store 20 unique random numbers between 0 and 100 (inclusive) in the array. Save your program as Question2…
Arrays · 3 marks · official answer ready
(a) The binary tree is stored as a global array with the identifier TreeArray. The left pointer, the data and the right pointer of each node are initialised to –1 The global varia…
Arrays · 2 marks · official answer ready
2 A program reads string data from a text file into a linear queue and then compresses the data. The queue is created using the global 1D array Queue. The queue can store up to 10…
Arrays · 3 marks · official answer ready
3 A program is written to perform different individual processes using arrays. (a) A 1D array stores 10 integers. (ii) The main program stores the following data in a 1D array of …
Arrays · 1 mark · official answer ready
3 A program is written to perform different individual processes using arrays. (a) A 1D array stores 10 integers. (iii) Test your program. Take a screenshot of the output(s). Save…
Arrays · 6 marks · official answer ready
3 A program is written to perform different individual processes using arrays. (b) The program stores the following string. The string has four statements that are each terminated…
Arrays · 2 marks · official answer ready
3 A program is written to perform different individual processes using arrays. (b) The program stores the following string. The string has four statements that are each terminated…
Arrays · 0 marks · official answer ready
(i) The array is represented in the diagram. A pointer value of –1 indicates the end of the linked list. Complete the pointer field to produce a linked list that is in alphabetica…
Arrays · 4 marks · official answer ready
(b) A 1D array DataArray holds up to 1000 elements of type integer and needs to be sorted in ascending order. Write the pseudocode for an insertion sort to sort the array into asc…
Arrays · 6 marks · official answer ready
(b) The procedure SplitData() takes a 1D string array as a parameter with the identifier DataArray The procedure declares six 1D arrays: one array for each colour that appears in …
Arrays · 2 marks · official answer ready
(d) Each of the six colours has a blank text file where the numbers will be stored. The names of these six text files are: • Blue.txt • Green.txt • Orange.txt • Pink.txt • Red.txt…
Arrays · 12 marks · official answer ready
(i) Write program code to declare the global arrays HashTable and Spare Save your program. Copy and paste the program code into part 2(b)(i) in the evidence document. [1]
Arrays · 12 marks · official answer ready
(ii) The main program should call the procedure to initialise the arrays, call the procedure to create the hash table and then call the procedure to output the contents of the arr…
Arrays · 1 mark · official answer ready
(ii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 1(e)(ii) in the evidence document. [1] 4
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() ..................................................................…
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…
