Structured programming and subroutines (procedures and functions)

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142
Question 7
Easy

A software engineer is writing a subroutine calculate_trajectory() that is called multiple times within a drone flight simulation. They choose to declare the variables representing intermediate velocity coordinates as local variables within the subroutine rather than as global variables.

State one property of local variables that makes them more appropriate than global variables for this purpose.

[1]

Structured programming and subroutines (procedures and functions) Questions

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