(a) What is: (i) an array; (ii) a syntax error?
(b) Write QBASIC program that will input multiples of Three between 1 and 20 into a one-dimensional array and display the output on the screen.
(c) Convert D5FA,, to binary.
Explanation
(a)(i) An array is a collection of elements of the same type stored in a single variable.
OR
An array is a data structure with homogeneous element.
OR An array is a row of values, a column of values or a combination of rows and columns of values.
OR
An array is a data structure consisting of a collection of elements (values or variables) each identified by at least an array index or key.
(i) A syntax error is an error resulting from violation of grammatical rules of a language.
OR
A syntax error is an error from non compliance with the grammar of a language
(b) 10 DIM M (7)
20 PRINT "MULTIPLE OF 3"
30 FOR I = 1 TO 6
40 M() = 3 *I
50 PRINT M(I)
60 NEXT I
70 END
OR
10 FOR I = 1 TO 6
20 M(I) =3 *I
30 PRINT M(I)
40 NEXT I
(c) Converting D5 FA\(_{16}\) to binary
D = 1101
5 = 0101
F = 1111
A = 1010
D5FA\(_{16}\) = 1101010111111010\(_{2}\)