The following pseudocode algorithm is designed to identify the minimum pressure drop between successive readings in a 0-indexed array called barometric_readings.
01 min_drop = 99999
02 for i = 0 to barometric_readings.length
03 drop = barometric_readings[i] - barometric_readings[i+1]
04 if drop < min_drop
05 min_drop = drop
06 endif
07 next i
08 print(min_drop)
The function length returns the number of elements in the array. This algorithm contains errors that prevent it from executing or functioning as intended.
Two types of errors that can occur in programming are syntax errors and logic errors.
State what is meant by:
A syntax error
A logic error
95 exam-style questions on OCR GCSE Computer Science Programming fundamentals. Each one has a worked solution and a mark scheme showing where the marks go.