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.Practise AQA GCSE Computer Science Programming concepts with exam-style questions for GCSE Computer Science. 100 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.