Skip to content

Course home

Algorithms

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]
Markscheme

Algorithms Questions

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

45 exam-style questions on Edexcel IGCSE Computer Science Algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank