Structured programming and subroutines (procedures and functions)

EasyMediumHard
1234567891011121314
Question 1
Hard

Develop a subroutine that calculates the resource extraction progress of a mining drone on an asteroid survey grid.

The subroutine should:

  • have a sensible identifier
  • take a 2D array named surveyGrid as a parameter
  • work out and output how many resources have already been extracted (represented by the character 'X' in the grid)
  • work out how many remaining unextracted resources (represented by the character 'R') are left and:
    • if 0, then output 'Fully depleted'
    • if 1, 2, or 3, then output 'Resources low'
[11]

Structured programming and subroutines (procedures and functions) Questions

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