Information Technology-JAN2012 (PAPER 2) - Solution - QU 9 - 12
Information Technology-JAN2012 (PAPER 2) - Solution - QU 9 - 12
Information Technology-JAN2012 (PAPER 2) - Solution - QU 9 - 12
January 2012
Answer Sheet
TOTAL 15 MARKS
B). The type of error that is highlighted SYNTAX ERROR(i.e. :=) (1 mark)
C). Examples of each of the following (using the PASCAL code provided) (5 marks)
i. A loop while (i <= 3) do
ii. An assignment statement sum := 0; OR sum := sum + 1; OR i := i + 1;
iii. A declaration var sum, I : Integer;
iv. A program header program SumNumbers;
v. A condition (i <= 3)
TOTAL 10 MARKS
Question 11 ARRAY
A). Array size is 4 (four) (1 mark)
B). The index numbers order to output the letter C A T 3, 2, 4 (3 marks)
C). Write (WORDS[4]); ( 2marks)
D). A fragment of code to search the array for the letter C(5 marks)
FOR count : = 1 TO 4 DO
IF WORDS [count] = C THEN
Write (count);
OR
FOR index : = 1 TO 4 DO
IF WORDS [index] = C THEN
Write (index);
E). A fragment of code to write the letter Z into EACH cell of the array.(4 marks)
FOR count : = 1 TO 4 DO
WORDS [count] : = Z
OR
FOR index : = 1 TO 4 DO
WORDS [index] : = Z
TOTAL 15 MARKS
Question 12 Algorithm
A). PRINT Please enter a letter (1 mark)
B). READ CHECK (1 mark)
C). IF CHECK = A THEN
PRINT GOOD (3 marks)
TOTAL 5 MARKS