Designing, creating and refining algorithms
50
0/4

This pseudocode algorithm calculates the product of all the numbers in the 0-indexed array multipliers.

01  product = 1
02  for count = 1 to multipliers.length - 1
03      multipliers[count] = product * multipliers[count]
04  next count
05  print(product)

The function length returns the number of elements in the array.

The algorithm contains several errors.

Identify two logic errors in the pseudocode algorithm.

Write the refined line to correct each error.

[4]

Designing, creating and refining algorithms Questions

Practise OCR GCSE Computer Science Designing, creating and refining algorithms with exam-style questions for GCSE Computer Science. 50 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.

Previous

Designing, creating and refining algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Designing, creating and refining algorithms