Structured programming and subroutines (procedures and functions)

EasyMediumHard
1234567891011121314
Question 10
Hard

Develop a subroutine that analyzes a wildlife monitoring grid for conservation efforts in a nature reserve.

The subroutine should:

  • have a sensible identifier
  • take a 2D array named parkGrid as a parameter
  • work out and output how many active poacher traps have been detected and disabled (represented by the character 'T' in the grid)
  • work out how many endangered rhinos (represented by the character 'R') are remaining in the grid and:
    • if 0, then output 'Critical: No rhinos detected'
    • if between 1 and 5 inclusive, then output 'Vulnerable sector'
[11]

Structured programming and subroutines (procedures and functions) Questions

  1. GCSE
  2. /Computer Science
  3. /Structured programming and subroutines (procedures and functions)