- Messages
- 73
- Reaction score
- 2
- Points
- 0
6 D=1
INPUT X, E
B=E
C=E
FOR I = 1 TO (X-1)
INPUT A
IF A>B THEN B = A
ELSE IF A < C THEN C = A
END IF
END IF
D = D + 1
E = E + A
NEXT
F = E/D
OUTPUT B, C, F
END
(a) State the output values of B, C and F for the following input test data
4, 6, 3, 7, 0 [3]
(b) Give three other different sets of test data, explaining what condition each is meant to test.
HOW TO GET THE ANSWER
INPUT X, E
B=E
C=E
FOR I = 1 TO (X-1)
INPUT A
IF A>B THEN B = A
ELSE IF A < C THEN C = A
END IF
END IF
D = D + 1
E = E + A
NEXT
F = E/D
OUTPUT B, C, F
END
(a) State the output values of B, C and F for the following input test data
4, 6, 3, 7, 0 [3]
(b) Give three other different sets of test data, explaining what condition each is meant to test.
HOW TO GET THE ANSWER