Programming fundamentals
2
0/2

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.

A syntax error

[1]
b.

A logic error

[1]

Programming fundamentals Questions

Practise OCR GCSE Computer Science Programming fundamentals with exam-style questions for GCSE Computer Science. 100 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Programming fundamentals Questions

  1. GCSE
  2. /Computer Science
  3. /Programming fundamentals