academyEX logo

Question 8 Level 5 - Operators and Variables

Why do we add selections using comparative operators in coding?

  1. To create loops for repeated blocks

  2. To allow programmes to make decisions based on data

  3. To help debug algorithms

  4. To identify parity bits

B is correct

If programmes were unable to make decisions on their own, then they would perform the same actions every time. This would not make them very useful. Comparative operators compare data against specific options to lead to different outcomes. For example, an app that shows the weather might use the current temperature to choose which icon to display on the screen.