8.2 Arrays
33 questions in this subtopic. Open a question to solve it and check the official answer.
Arrays · 15 marks · official answer ready
11 The scores for each competitor in an archery competition are recorded. The one-dimensional (1D) array CompetitorName[] is used to store the names of the competitors. The maximu…
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
8 A collector needs a video library system for a collection of videos stored on 4K Blu-ray discs, standard Blu-ray discs, DVD, or as digital downloads. The two-dimensional (2D) ar…
Arrays · 2 marks · official answer ready
(b) Write the pseudocode statement to output the average of the numbers, rounded to two decimal places. ...........................................................................…
Arrays · 15 marks · official answer ready
10 A sports club uses a six-character alphanumeric membership code to identify each member of the club. The one-dimensional (1D) array MemberID[] is used to store the unique membe…
Arrays · 3 marks · official answer ready
(b) Write the pseudocode to display, with suitable messages, the number of zeros stored in the array and the total of the non-zero values. ........................................…
Arrays · 17 marks
(ii) Explain how one of the lines in your statement in part (d)(i) could be changed to display the same information. ..............................................................…
Arrays · 15 marks · official answer ready
12 A one-dimensional (1D) array Rooms[] contains the names of up to 20 rooms in a house. A two-dimensional (2D) array Dimensions[] is used to store the length, width and area of e…
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) Write the pseudocode that you could add to the end of this algorithm to output the contents of the array. Make sure that the output ends when the data in the array ends. .....…
Arrays · 15 marks · official answer ready
9 A one-dimensional (1D) array Teams[] contains the names of 10 football teams in a local league. A two-dimensional (2D) array Results[] stores, for each team, the total number of…
Arrays · 15 marks · official answer ready
11 Students in a class are recording the amount of time in minutes spent in front of a screen for each day of the week. The one-dimensional (1D) array StudentName[] contains the n…
Arrays · 15 marks · official answer ready
10 Drama students put on a performance of a play for one evening. Seats in a small theatre can be booked for this performance. The theatre has 10 rows of 20 seats. The status of t…
