Which two of the following statements about the program in Figure 1 are true when it is used with the grid in Figure 2?
Figure 1: Thermal Scan Code
target_row = -1
target_col = -1
for r in range(0, 4):
for c in range(0, 4):
if get_temp(r, c) > 35:
target_row = r
target_col = c
Figure 2: Grid Values (4x4 grid representing temperature measurements in °C)
| Column 0 | Column 1 | Column 2 | Column 3 | |
|---|---|---|---|---|
| Row 0 | 21 | 24 | 22 | 19 |
| Row 1 | 23 | 36 | 31 | 20 |
| Row 2 | 22 | 25 | 30 | 28 |
| Row 3 | 20 | 23 | 37 | 24 |
Select two options:
target_row will be 1.get_temp(r, c) > 35 is executed sixteen times.for r in range(0, 4), executes its block sixteen times.target_row and target_col are updated during every single iteration of the inner loop.298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.