Skip to content

Course home

Programming fundamentals

Programming fundamentals

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
Question 43

The following pseudocode algorithm is intended to find the minimum value of elements in a 0-indexed array of rocket sensor readings called thrust_readings.

01  min_thrust = 99999
02  for i = 0 to thrust_readings.length
03      if thrust_readings[i] < min_thrust
04          min_thrust = thrust_readings[i]
05      endif
06  next i
07  print(min_thrust)

The function length returns the total number of elements in the array. This algorithm contains errors that prevent it from working as intended.

Two types of errors that can occur when designing and writing programs are syntax errors and logic errors.

State what is meant by:

a.

A syntax error

[1]
b.

A logic error

[1]
Markscheme

Programming fundamentals Questions

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

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.

Question bank