Skip to content

Course home

Sign up

Develop code

EasyMediumHard
12345678910111213141516171819
Question 11

State the purpose of this algorithm.

1 SET salinity TO 0.0
2 SET min_salinity TO 100.0
3 SET max_salinity TO -1.0
4
5 FOR EACH salinity FROM "SalinityReadings.dat" DO
6     IF (salinity < min_salinity) THEN
7         SET min_salinity TO salinity
8     ENDIF
9     IF (salinity > max_salinity) THEN
10        SET max_salinity TO salinity
11    ENDIF
12 ENDFOR
13
14 SEND min_salinity & " to " & max_salinity TO DISPLAY
[1]
Markscheme

Develop code Questions

  1. GCSE
  2. /Computer Science
  3. /Develop code

51 exam-style questions on Edexcel GCSE Computer Science Develop code, covering Decomposition and abstraction to solve problems, Read, write, analyse and refine programs, Converting algorithms into programs, Techniques for readable, maintainable code, Identifying and correcting program errors, and Evaluating program fitness and efficiency. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank