Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1DECLARE Prices : ARRAY[1:10] OF REAL | AAn array of ten elements, each of which can hold a number with a decimal part, such as 2.50 | |
| 2DECLARE Flags : ARRAY[1:30] OF BOOLEAN | BDECLARE Letters : ARRAY[1:26] OF CHAR | |
| 3The array must store ten whole-number test scores, so the element data type is INTEGER | CAn array of thirty elements, each of which can only hold TRUE or FALSE | |
| 4The array must store the 26 letters of the alphabet, one single character in each element | DDECLARE Scores : ARRAY[1:10] OF INTEGER | |
| 5DECLARE Prices : ARRAY[1:10] OF INTEGER Prices[1] ← 2.50 | EA BOOLEAN element can only hold TRUE or FALSE. The text "Yes" is a string, so it does not match the element data type. It should be Flags[1] ← TRUE. | |
| 6DECLARE Flags : ARRAY[1:30] OF BOOLEAN Flags[1] ← "Yes" | FThe array is declared OF INTEGER, so its elements can only hold whole numbers. The decimal 2.50 does not fit. The type after OF should be REAL. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
ARRAY[1:10] OF INTEGER — The data type after OF decides what every element can hold. ARRAY[1:10] OF INTEGER holds ten whole-number scores; REAL, CHAR, STRING or BOOLEAN would hold other kinds of data.DECLARE Scores : ARRAY[1:10] OF INTEGERDECLARE Prices : ARRAY[1:10] OF REALDECLARE Letters : ARRAY[1:26] OF CHARDECLARE Present : ARRAY[1:30] OF BOOLEANDECLARE Names : ARRAY[1:30] OF STRING
Names[1] ← "Ava"