1Medium50%
0/1

An automated system monitoring critical server performance runs the algorithm shown in Figure 1.

Figure 1

1   priority ← USERINPUT
2   IF priority = 'high' THEN
3       passes ← 3
4       limit ← 5
5   ELSE IF priority = 'standard' THEN
6       passes ← 2
7       limit ← 4
8   ELSE
9       passes ← 1
10      limit ← 2
11  ENDIF
12  count ← 0
13  FOR i ← 1 TO passes
14      j ← 1
15      WHILE j ≤ i DO
16          IF count < limit THEN
17              SEND_ALERT()
18              count ← count + 3
19          ENDIF
20          j ← j + 1
21      ENDWHILE
22  ENDFOR

How many times would the subroutine SEND_ALERT be called if the user input is 'high'?

222

333

555

666

Representing algorithms Questions

Practise AQA GCSE Computer Science Representing algorithms with exam-style questions for GCSE Computer Science. 100 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

Next

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms