8.2 Arrays
32 questions in this subtopic. Open a question to solve it and check the official answer.
Arrays · 4 marks · official answer ready
(c) The algorithm on page 6 requires the array CodeStore[] to be declared as a one‑dimensional (1D) string array with six elements that are initially set to the null string "". Wr…
Arrays · 15 marks · official answer ready
8 A program is required to test the fairness of the random number generator. The one‑dimensional (1D) array RandomNumber[] is used to store 100 000 random integers. The two‑dimens…
Arrays · 15 marks · official answer ready
10 A number game has two players. Random whole numbers are generated for each player. The numbers are compared and players are given points based on the result of the comparison. …
Arrays · 4 marks · official answer ready
3 The following pseudocode algorithm uses a count-controlled loop to read in 10 names and store them in the array Names[] FOR Count 1 TO 10 OUTPUT "Please enter a name" INPUT Name…
Arrays · 15 marks · official answer ready
11 The one-dimensional (1D) array CompetitorName[] contains the names of 25 competitors in a tournament that includes five events. Another two-dimensional (2D) array CompetitorSco…
Arrays · 2 marks · official answer ready
(b) Write the pseudocode statement that will output the average height rounded to one decimal place. ..............................................................................…
Arrays · 15 marks · official answer ready
10 The one-dimensional (1D) array Clubs[] is used to store the names of 12 cricket clubs in a local sports league. The two-dimensional (2D) array Statistics[] is used to store, fo…
Arrays · 5 marks · official answer ready
(a) Give a line number for each of these types of statement: Assignment statement .................................................................................................…
Arrays · 15 marks · official answer ready
11 A one-player game uses the two-dimensional (2D) array Grid[] to store the location of a secret cell to be found by the player in 10 moves. Each row and column has 5 cells. Star…
Arrays · 4 marks · official answer ready
(b) A one‑dimensional (1D) array called Temperatures[] has 25 elements beginning at index 1. It holds values that range between –20 and 100 inclusive. Write a pseudocode algorithm…
Arrays · 15 marks · official answer ready
11 A wood flooring company stores the names of up to 100 customers in a one‑dimensional (1D) array Customers[]. A two‑dimensional (2D) array Quotations[] stores details of each cu…
Arrays · 15 marks · official answer ready
10 A weather station takes temperature readings once an hour for a week. These temperatures are stored in a two-dimensional (2D) array Temperatures[] Each column contains 24 readi…
Arrays · 15 marks · official answer ready
11 A one-dimensional (1D) array Days[] contains the names of the days of the week. A two-dimensional (2D) array Readings[] is used to store 24 temperature readings, taken once an …
Arrays · 23 marks
(c) Describe one problem that could occur with this algorithm if an invalid character was input. ..................................................................................…
Arrays · 4 marks · official answer ready
(b) The corrected algorithm needs to be changed so that any number of marks may be entered and the algorithm runs until the user tells it to stop. Write the new pseudocode stateme…
Arrays · 4 marks · official answer ready
(b) Write a pseudocode routine that will check that each test result entered into the algorithm is between 0 and 100 inclusive. ...................................................…
Arrays · 3 marks · official answer ready
3 (a) Describe a one-dimensional array. Include an example of an array declaration. ...............................................................................................…
Arrays · 2 marks · official answer ready
(b) Explain how indexing could be used to search for a value stored in a one-dimensional array. ...................................................................................…
Arrays · 5 marks · official answer ready
(ii) Describe the arrays you could have used in Task 1. Include the name, data type, use and sample data for each array. ..........................................................…
Arrays · 3 marks · official answer ready
(a) Write a pseudocode routine that sets each element to zero. Use the most suitable loop structure. ..............................................................................…
