8Hard
0/9

An environmental monitoring station tracks water salinity levels (in parts per thousand, ppt) across several estuarine research zones to protect a sensitive fish species. If a zone's salinity falls outside the safe range, marine biologists must be immediately alerted.

  • The ideal salinity for the fish species is 15 ppt15\text{ ppt}15 ppt.
  • The permissible salinity tolerance is plus or minus four parts per thousand (an inclusive range of 11 ppt11\text{ ppt}11 ppt to 19 ppt19\text{ ppt}19 ppt).
  • Only zones with salinity levels strictly outside this tolerance (less than 11 ppt11\text{ ppt}11 ppt or greater than 19 ppt19\text{ ppt}19 ppt) are considered critical.
  • An output message must be displayed to show the index and salinity of any zone that is critical.
  • The output message for each critical zone must be on a single line.
  • No other messages should be displayed.
  • A global data structure holding the salinity measurements is provided and must be used as part of the solution:

SET zoneSalinity TO [15, 12, 9, 21, 19, 22, 11]

  • The solution should work even if the number of zones in the data structure is changed.

An example output for the dataset above is shown:

Zone 2 is critical: 9 ppt
Zone 3 is critical: 21 ppt
Zone 5 is critical: 22 ppt

Write an algorithm to inform marine biologists of any critical zones. Use pseudocode or a programming language with which you are familiar.

[9]

Constructs Questions

Practise Edexcel GCSE Computer Science Constructs with exam-style questions for GCSE Computer Science. 61 questions covering Structural components of programs and Writing programs with control constructs, matched to the Edexcel GCSE Computer Science (1CP2) specification and written in Paper 1 and Paper 2 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.

PreviousNext

Constructs Questions

  1. GCSE
  2. /Computer Science
  3. /Constructs