Write a subroutine in VB.Net called monitorPollution that counts the number of plastic pollution hotspots in a marine survey grid.
The marine survey grid is represented as a 4x4 2D array of strings, where hotspots are represented by the string "P".
An example of the oceanGrid array is shown in Figure 1 below:
Figure 1
| 0 | 1 | 2 | 3 | |
|---|---|---|---|---|
| 0 | Clear | P | Clear | Clear |
| 1 | P | Clear | P | Clear |
| 2 | Clear | Clear | Clear | P |
| 3 | P | P | Clear | Clear |
Environmental protection protocols require you to determine if an area is critically polluted.
The subroutine should:
oceanGrid as a parameter"P" elements in the array"Critical" if there are seven or more "P" elements in the array"P" elements if there are fewer than seven.You must write your own counting routine utilizing nested loops and not use any built-in search or counting functions that might be available in VB.Net. You can assume the nested loops will iterate over a fixed 4x4 grid.
You should use meaningful variable names and correct VB.Net syntax in your answer.