Skip to content

Course home

Sign up

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
Question 40

A pseudocode algorithm that monitors network server latency readings is shown below.

The first four inputs read from the file LatencyLog.txt are 145, 82, 310, and 195 in that order.

Complete the trace table showing the execution of the pseudocode with these four inputs. You may not need to use all the rows in the table.

1 SET latency TO 0
2 SET min_lat TO 999
3 SET max_lat TO 0
4
5 FOR EACH latency FROM "LatencyLog.txt" DO
6     IF (latency < min_lat) THEN
7         SET min_lat TO latency
8     ENDIF
9     IF (latency > max_lat) THEN
10        SET max_lat TO latency
11    ENDIF
12 END FOREACH
13
14 SEND min_lat & " - " & max_lat TO DISPLAY
latencymin_latmax_latDisplay
[6]
Markscheme

Computational thinking Questions

  1. GCSE
  2. /Computer Science
  3. /Computational thinking

Question bank