Skip to content

Course home

Sign up

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
Question 67

A computer science student has written a block of pseudocode to find the minimum atmospheric pressure recorded during a weather balloon flight from an array of 6 sensor readings.

1  pressures = [1013, 998, 985, 1002, 991, 1007]
2  lowest = pressures
3  idx = 1
4  WHILE idx <= 6
5      IF pressures[idx] < lowest THEN
6          pressures[idx] = lowest
7      ENDIF
8      idx = idx + 1
9  ENDWHILE
10 OUTPUT "Lowest pressure: " + lowest

Line 4 and Line 6 contain errors.

Identify the error in each line and construct new lines of pseudocode that will correct the errors.

Line NumberErrorCorrection
Line 4
Line 6
[4]
Markscheme

Computational thinking Questions

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

Question bank