Uter
Uter
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Draw a program flowchart for an algorithm that will output each element in the array.
[4]
© UCLES 2021 9608/23/M/J/21 [Turn over
6
[6]
© UCLES 2021 9618/21/M/J/21
6
[6]
© UCLES 2021 9618/23/M/J/21
4
[5]
© UCLES 2021 9618/22/O/N/21 [Turn over
4
2 (a) The following pseudocode algorithm counts the number of each alphabetic character in the
string Msg. The character count values are stored in an array CharCount.
FOR Index 1 TO 26
CharCount[Index] 0
ENDFOR
[5]
PROCEDURE LEM()
Overload FALSE
Landed FALSE
ENDPROCEDURE
Answer
[5]
[5]
© UCLES 2021 9608/22/M/J/21 [Turn over
6
START
Set Count to 1
Is Flag = YES
FALSE AND
Count <= 5 ?
NO
ReBoot()
Is Flag = YES
FALSE ?
NO
Alert(27)
END
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
............................................................................................................................................................ [6]
(c) The program flowchart for part of an algorithm from a mobile phone program is shown.
Identifier Active is a global variable of type BOOLEAN.
START
Is Online = NO
FALSE ?
YES END
Is Active = NO
TRUE ?
YES
CALL Reset()
CALL Sync()
Is Active = YES
FALSE ?
NO
CALL Error("No
Signal")
CALL ReCheck()
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]