Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
Question 1
49%

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'?

A

222

B

333

C

555

D

666

Markscheme

Representing algorithms Questions

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

208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank