An athletics track design program uses the following sub-program to calculate the total distance of a race in kilometres:
global conversionFactor = 1.609
function calculateTrackLength(laps, lapLengthMiles)
distanceMiles = laps * lapLengthMiles
distanceKm = distanceMiles * conversionFactor
return distanceKm
endfunction
State the name of one local variable used in this sub-program.
29 exam-style questions on Edexcel GCSE Computer Science Subprograms, covering Built-in and user-devised subprograms, Functions versus procedures, and Global and local variables. Each one has a worked solution and a mark scheme showing where the marks go.