Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Algorithms

EasyMedium
123456789101112131415161718192021222324252627
Question 26

The following pseudocode algorithm is intended to input 8 exam marks, find the highest mark, and display it. However, the algorithm contains a logic error and does not work correctly.

1  SET highest_mark TO 0
2  SET current_mark TO 0
3  FOR count FROM 1 TO 8 DO
4      RECEIVE current_mark FROM (INTEGER) KEYBOARD
5      IF current_mark < highest_mark THEN
6          SET highest_mark TO current_mark
7      END IF
8  END FOR
9  SEND 'The highest mark is: ' & highest_mark TO DISPLAY

Amend a single line of pseudocode to correct the logic error. Write the amended line in full, including its line number.

[1]

Algorithms Questions

  1. IGCSE
  2. /Computer Science
  3. /Algorithms