An environmental monitoring grid measures river contamination levels across several parallel sensor lines, each having multiple detection nodes. A researcher wants to write a script to monitor the first sensor line (index 0) to detect a localized contamination spike.
Write a Python program to:
You must use the getContamination subroutine described below in your Python code.
| Subroutine | Purpose |
|---|---|
getContamination(line, node) | Returns the contamination level (as an integer) detected at (line, node) |
| node 0 | node 1 | node 2 | |
|---|---|---|---|
| line 0 | 12 | 18 | 25 |
| line 1 | 10 | 11 | 9 |
For Example A, the program should display Spike (since 12 < 18 < 25).
| node 0 | node 1 | node 2 | |
|---|---|---|---|
| line 0 | 15 | 14 | 20 |
| line 1 | 8 | 12 | 11 |
For Example B, the program should display Stable (since 14 is not greater than 15).
131 exam-style questions on AQA GCSE Computer Science Structured programming and subroutines (procedures and functions). Each one has a worked solution and a mark scheme showing where the marks go.