Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
Question 97

An algorithm for a deep-space communications probe verifying its connection sequence is shown in Figure 1.

Regardless of what values are input, the same number of OUTPUT instructions will always execute when the algorithm runs.

Figure 1

1  OUTPUT 'Establishing communication link with Deep Space Network...'
2  connectionMode ← USERINPUT
3  IF connectionMode = 'high-gain' THEN
4      OUTPUT 'Configuring parabolic antenna array.'
5      signalStrength ← USERINPUT
6      IF signalStrength < 15 THEN
7          OUTPUT 'Signal low: Initiating carrier-wave amplification.'
8          OUTPUT 'Warning: Transmit latency will exceed 12 minutes.'
9      ELSE
10         OUTPUT 'Signal nominal: Locking phase-locked loop.'
11         OUTPUT 'Ready for high-bandwidth telemetry stream.'
12     ENDIF
13 ELSE
14     OUTPUT 'Initializing low-gain omnidirectional dipole.'
15     powerBudget ← USERINPUT
16     IF powerBudget = 'restricted' THEN
17         OUTPUT 'Low-power state: Disabling non-essential subsystems.'
18         OUTPUT 'Transmitting beacon packets only.'
19     ELSE
20         OUTPUT 'Standard power: Engaging multi-frequency ping.'
21         OUTPUT 'Awaiting ground station handshake.'
22     ENDIF
23 ENDIF

State how many OUTPUT instructions will execute whenever this algorithm is run.

[1]
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